File tree Expand file tree Collapse file tree 2 files changed +57
-72
lines changed
Expand file tree Collapse file tree 2 files changed +57
-72
lines changed Original file line number Diff line number Diff line change 1+ name : Release FFI Version
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : " New semver tag (e.g. v0.2.0)"
8+ required : true
9+ type : string
10+
11+ jobs :
12+ create-release :
13+ name : Tag and Release
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : write
17+
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0
23+
24+ - name : Set up Git
25+ run : |
26+ git config user.name "github-actions[bot]"
27+ git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+ - name : Get latest tag
30+ id : latest_tag
31+ run : |
32+ TAG=$(git describe --tags --abbrev=0 || echo "")
33+ echo "latest_tag=$TAG" >> "$GITHUB_OUTPUT"
34+
35+ - name : Create annotated tag
36+ run : |
37+ git tag -a "${{ inputs.tag }}" -m "Release ${{ inputs.tag }}"
38+ git push origin "${{ inputs.tag }}"
39+
40+ - name : Generate changelog
41+ id : changelog
42+ run : |
43+ if [ -z "${{ steps.latest_tag.outputs.latest_tag }}" ]; then
44+ git log --oneline > full_changelog.txt
45+ else
46+ git log --oneline "${{ steps.latest_tag.outputs.latest_tag }}"..HEAD > full_changelog.txt
47+ fi
48+ echo 'changelog<<EOF' >> $GITHUB_OUTPUT
49+ cat full_changelog.txt >> $GITHUB_OUTPUT
50+ echo 'EOF' >> $GITHUB_OUTPUT
51+
52+ - name : Create GitHub release
53+ uses : softprops/action-gh-release@v2
54+ with :
55+ tag_name : ${{ inputs.tag }}
56+ name : Release ${{ inputs.tag }}
57+ body : ${{ steps.changelog.outputs.changelog }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments