Skip to content

Commit 980caf4

Browse files
committed
add snapshots
1 parent 22bdf30 commit 980caf4

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
name: goreleaser
33

44
on:
5+
workflow_dispatch:
6+
pull_request:
57
push:
6-
branches:
7-
- 'main'
8-
tags:
9-
- 'v*'
8+
tags: ['v*']
109

1110
permissions:
1211
contents: write
13-
# packages: write
14-
# issues: write
15-
# id-token: write
12+
id-token: write
13+
packages: write
1614

1715
jobs:
1816
goreleaser:
1917
runs-on: ubuntu-latest
18+
env:
19+
flags: ""
2020
steps:
21+
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
22+
run: echo "flags=--snapshot" >> $GITHUB_ENV
2123
- name: Checkout
2224
uses: actions/checkout@v4
2325
with:
@@ -35,7 +37,7 @@ jobs:
3537
distribution: goreleaser
3638
# 'latest', 'nightly', or a semver
3739
version: "~> v2"
38-
args: release --clean
40+
args: release --clean ${{ env.flags }}
3941
env:
4042
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4143
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution

.goreleaser.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
version: 2
2+
before:
3+
hooks:
4+
- go mod download
25
builds:
36
- env:
47
- CGO_ENABLED=0

0 commit comments

Comments
 (0)