-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (58 loc) · 1.57 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: Release
on: workflow_dispatch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
tag:
name: Tag
runs-on: ubuntu-latest
permissions:
# NOTE: necessary to apply the git tag.
contents: write
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
# Using this to pick up the latest tag.
fetch-depth: 0
- name: Get next version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
minorList: 'major, breaking'
patchList: 'feat, fix, bugfix, perf, refactor, test, tests, doc, docs'
- name: Push new version tag
uses: rickstaa/action-create-tag@v1
if: ${{ contains(github.ref, 'main') }} # only push tags if on main branch.
with:
tag: ${{ steps.semver.outputs.next }}
tag_exists_error: false
force_push_tag: true
release:
name: Release
runs-on: ubuntu-latest
needs: [tag]
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ github.token }}