-
Notifications
You must be signed in to change notification settings - Fork 452
78 lines (67 loc) · 1.84 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
name: Release
on:
push:
tags: [ v*.*.* ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: GPG config
run: |
mkdir -p ~/.gnupg
cat << EOF >> ~/.gnupg/gpg.conf
keyserver hkps://keys.openpgp.org
auto-key-import
auto-key-retrieve
EOF
-
name: Verify tag signature
run: |
# NOTE: Solve the problem with Github action checkout
# https://github.com/actions/checkout/issues/290
git fetch --tags --force
version=${GITHUB_REF#refs/tags/*}
git show $version
git tag -v $version
-
name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
check-latest: true
cache: true
-
name: Build release changelog
run: |
version=${GITHUB_REF#refs/tags/v*}
mkdir -p tmp
sed '/^# \['$version'\]/,/^# \[/!d;//d;/^\s*$/d' CHANGELOG.md > tmp/release_changelog.md
-
name: Release
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200
with:
distribution: goreleaser
version: v1.10.3
args: release --rm-dist --release-notes=tmp/release_changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}