-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (41 loc) · 1.16 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: release
on:
push:
branches:
- main
pull_request:
permissions:
contents: write # create releases
packages: write # push to ghcr
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: WillAbides/[email protected]
with:
go-version: stable
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: go-semantic-release/action@v1
with:
allow-initial-development-versions: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go mod download -x
- name: Define goreleaser flags
run: test -n "$(git tag --points-at HEAD)" || echo "GORELEASER_FLAGS=--snapshot" >> $GITHUB_ENV
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean ${{ env.GORELEASER_FLAGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}