-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 957 Bytes
/
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
name: release
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Run Release
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: ${{ env.IS_TAG_PUSH == 'true' && 'release --clean' || 'release --clean --snapshot' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IS_TAG_PUSH: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build
path: dist/*