-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 986 Bytes
/
cli-release.yaml
File metadata and controls
39 lines (34 loc) · 986 Bytes
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
name: Release CLI
on:
push:
tags:
- "cli/v*"
jobs:
release:
runs-on: proxmox-lxc
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Extract changelog
run: |
VERSION=${GITHUB_REF_NAME#cli/}
CHANGES=$(awk -v ver="$VERSION" '
$0 ~ "^## \\[" ver "\\]" {found=1; next}
$0 ~ "^## \\[" {found=0}
found {print}
' CHANGELOG.md)
if [ -z "$CHANGES" ]; then
CHANGES="No changelog entry was found for this release."
fi
echo "## Changelog" > release_notes.md
echo "" >> release_notes.md
echo "$CHANGES" >> release_notes.md
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_NOTES_FILE: release_notes.md