Skip to content

Commit 3fe2928

Browse files
authored
Fixes for Gorelease 2.2 (#62)
And support for manually testing CI process
1 parent 342aa4e commit 3fe2928

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Diff for: .github/workflows/goreleaser.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ on:
88
jobs:
99
goreleaser:
1010
runs-on: ubuntu-latest
11+
env:
12+
flags: ""
1113
steps:
14+
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
15+
# Allows manually running this on an untagged commit without actually generating a release
16+
run: echo "flags=--snapshot" >> $GITHUB_ENV
1217
- name: Checkout
1318
uses: actions/checkout@v4
1419
with:
@@ -23,7 +28,7 @@ jobs:
2328
uses: goreleaser/goreleaser-action@v6
2429
with:
2530
distribution: goreleaser
26-
version: latest
31+
version: '~> v2'
2732
args: check
2833
workdir: ./src
2934
env:
@@ -33,8 +38,8 @@ jobs:
3338
with:
3439
# either 'goreleaser' (default) or 'goreleaser-pro'
3540
distribution: goreleaser
36-
version: latest
37-
args: release --clean
41+
version: '~> v2'
42+
args: release --clean ${{ env.flags }}
3843
workdir: ./src
3944
env:
4045
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Diff for: src/.goreleaser.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
before:
23
hooks:
34
- go mod tidy
@@ -25,7 +26,7 @@ archives:
2526
checksum:
2627
name_template: "checksums.txt"
2728
snapshot:
28-
name_template: "{{ incpatch .Version }}-next"
29+
version_template: "{{ incpatch .Version }}-next"
2930
changelog:
3031
use: github-native
3132
# sort: asc

0 commit comments

Comments
 (0)