-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (41 loc) · 1.18 KB
/
goreleaser.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
name: goreleaser
on:
push:
paths-ignore:
- README.md
- env.sample
branches:
- main
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
- name: Bump version and push tag
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
go install github.com/caarlos0/svu@latest
OLD_TAG=$(svu current --strip-prefix)
NEW_TAG=$(svu next --strip-prefix)
[ "$OLD_TAG" == "$NEW_TAG" ] && echo "no version bump" && exit 0
git commit -m "bump release version" --allow-empty
git tag v$NEW_TAG
git tag $NEW_TAG
git push
git push --tags
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}