-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.36 KB
/
release.yml
File metadata and controls
51 lines (44 loc) · 1.36 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
name: Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
- name: Download dependencies
run: go mod download
- name: Build binaries
run: make build-all VERSION=${{ github.ref_name }}
- name: Generate checksums
run: |
cd dist
sha256sum * > checksums.txt
- name: Extract Release Notes from Changelog
run: |
awk '/^## ${{ github.ref_name }}/{flag=1; next} /^## v/{flag=0} flag' CHANGELOG.md > release-notes.md
if [ ! -s release-notes.md ]; then
echo "No changelog entry found for ${{ github.ref_name }}, using auto-generated notes"
echo "Release ${{ github.ref_name }}" > release-notes.md
fi
- name: Create GitHub Release
run: |
IS_PRERELEASE=false
if [[ "${{ github.ref_name }}" == *-* ]]; then
IS_PRERELEASE=true
fi
gh release create ${{ github.ref_name }} \
--notes-file release-notes.md \
--draft=false \
--prerelease=$IS_PRERELEASE \
dist/*
env:
GH_TOKEN: ${{ github.token }}