-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 1.5 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (61 loc) · 1.5 KB
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
64
65
66
67
68
69
70
71
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Build and publish
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Verify
run: |
go test ./...
go vet ./...
- name: Build release archives
run: bash scripts/build-release.sh "${GITHUB_REF_NAME}"
- name: Verify release archives
run: |
(
cd dist
sha256sum --check checksums.txt
)
for archive in dist/*.tar.gz; do
tar -tzf "${archive}" >/dev/null
done
for archive in dist/*.zip; do
unzip -tq "${archive}"
done
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
options=(
"${GITHUB_REF_NAME}"
--verify-tag
--generate-notes
--title "${GITHUB_REF_NAME}"
)
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then
options+=(--prerelease)
fi
gh release create \
"${options[@]}" \
dist/*.tar.gz \
dist/*.zip \
dist/checksums.txt