File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v6
16+ with :
17+ fetch-depth : 0
18+
19+ - name : Check if stable release
20+ id : check
21+ run : |
22+ # align with build-docker.yml: stable only for strict semver tags
23+ if [[ "${{ github.ref_name }}" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
24+ echo "stable=true" >> "$GITHUB_OUTPUT"
25+ else
26+ echo "stable=false" >> "$GITHUB_OUTPUT"
27+ fi
28+
29+ - name : Extract changelog
30+ id : changelog
31+ run : |
32+ tag="${{ github.ref_name }}"
33+ body=$(sed -n "/^\# .*\[${tag}\]/,/^\# .*\[v/{/^\# .*\[v/!p}" CHANGELOG.md || true)
34+ cat >> "$GITHUB_OUTPUT" <<DELIM
35+ body<<EOF
36+ ${body}
37+
38+ **Full Changelog**: https://github.com/${{ github.repository }}/blob/${tag}/CHANGELOG.md
39+ EOF
40+ DELIM
41+
42+ - name : Create release
43+ uses : softprops/action-gh-release@v2
44+ with :
45+ body : ${{ steps.changelog.outputs.body }}
46+ draft : false
47+ prerelease : ${{ steps.check.outputs.stable != 'true' }}
48+ make_latest : ${{ steps.check.outputs.stable == 'true' }}
You can’t perform that action at this time.
0 commit comments