[chore] Ensure current tag not set as GORELEASER_PREVIOUS_TAG

This commit is contained in:
tobi 2024-10-13 14:35:46 +02:00
commit fe71c97144
2 changed files with 13 additions and 4 deletions

View file

@ -113,7 +113,7 @@ steps:
commands:
# Create a snapshot build with GoReleaser.
- git fetch --tags
- GORELEASER_PREVIOUS_TAG=$(git tag -l | grep -v rc | sort -V -r | head -n 1) goreleaser release --clean --snapshot
- goreleaser release --clean --snapshot
# Login to Docker, push Docker image snapshots + manifests.
- /go/dockerlogin.sh
@ -156,7 +156,16 @@ steps:
commands:
- git fetch --tags
- /go/dockerlogin.sh
- GORELEASER_PREVIOUS_TAG=$(git tag -l | grep -v rc | sort -V -r | head -n 1) goreleaser release --clean
# When releasing, compare commits to the most recent tag
# that is not the current one AND is not a release candidate
# version (ie., no "rc" in the tag name).
#
# Note, this may cause annoyances when doing backport releases
# (ie., releasing v0.10.1 when we've already released v0.15.0
# or whatever), but they should only be superficial annoyances.
- export GORELEASER_PREVIOUS_TAG=$(git tag -l | grep -v "rc\|${DRONE_TAG}" | sort -V -r | head -n 1)
- goreleaser release --clean
when:
event:
include:
@ -213,6 +222,6 @@ steps:
---
kind: signature
hmac: 3f2066e1e1f7f05b7cdb51327d6c9aea5d06a3dbceb518421110d9c1c3b325f8
hmac: 883be019998713a2e52465918f62a3289459b425f3aa7dffada505ffdccc4cba
...

View file

@ -195,7 +195,7 @@ Then install Node and Yarn as described in [Stylesheet / Web dev](#stylesheet--w
Finally, to create a snapshot build, do:
```bash
GORELEASER_PREVIOUS_TAG=$(git tag -l | grep -v rc | sort -V -r | head -n 1) goreleaser --clean --snapshot
goreleaser release --clean --snapshot
```
If all goes according to plan, you should now have a number of multiple-architecture binaries and tars inside the `./dist` folder, and snapshot Docker images should be built (check your terminal output for version).