-
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 2.21 KB
/
release.yml
File metadata and controls
64 lines (54 loc) · 2.21 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
# ! ┌───────────────────────────────────────────────────────────────────┐
# ! │ │
# ! │ IMPORTANT NOTE │
# ! │ │
# ! │ This file is synced with https://github.com/atomicgo/template │
# ! │ │
# ! │ Please apply all changes to the template repository │
# ! │ │
# ! └───────────────────────────────────────────────────────────────────┘
name: Release
on:
push:
tags:
- "v*.*.*"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
publish:
name: Publish GitHub release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Validate release tag
shell: bash
run: |
set -euo pipefail
if [[ ! "$GITHUB_REF_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Release tags must use vMAJOR.MINOR.PATCH, got '$GITHUB_REF_NAME'."
exit 1
fi
{
echo "## Release"
echo ""
echo "Preparing GitHub release for \`$GITHUB_REF_NAME\`."
} >> "$GITHUB_STEP_SUMMARY"
- name: Publish release
uses: softprops/action-gh-release@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
tag_name: ${{ github.ref_name }}
- name: Release summary
shell: bash
run: |
{
echo ""
echo "Release notes were generated by GitHub and published for \`${{ github.ref_name }}\`."
} >> "$GITHUB_STEP_SUMMARY"