File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ ## Release {VERSION}
2+
3+ ### Download Artifacts
4+ - 📦 Krkn sources (noarch): [ krkn-{VERSION}-src.tar.gz] ( https://krkn-chaos.gateway.scarf.sh/krkn-src-{VERSION}.tar.gz )
5+
6+ ### Changes
7+ {CHANGES}
Original file line number Diff line number Diff line change 1+ name : Create Release
2+ on :
3+ push :
4+ tags :
5+ - ' v*'
6+ jobs :
7+ release :
8+ permissions :
9+ contents : write
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ - name : calculate previous tag
14+ run : |
15+ git fetch --tags origin
16+ PREVIOUS_TAG=$(git tag --sort=-creatordate | sed -n '2 p')
17+ echo $PREVIOUS_TAG
18+ echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> "$GITHUB_ENV"
19+ - name : generate release notes from template
20+ id : release-notes
21+ env :
22+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23+ run : |
24+ NOTES=$(gh api \
25+ --method POST \
26+ -H "Accept: application/vnd.github+json" \
27+ -H "X-GitHub-Api-Version: 2022-11-28" \
28+ /repos/krkn-chaos/krkn/releases/generate-notes \
29+ -f "tag_name=${{ github.ref_name }}" -f "target_commitish=main" -f "previous_tag_name=${{ env.PREVIOUS_TAG }}" | jq -r .body)
30+ echo "NOTES<<EOF" >> $GITHUB_ENV
31+ echo "$NOTES" >> $GITHUB_ENV
32+ echo "EOF" >> $GITHUB_ENV
33+
34+ - name : replace placeholders in template
35+ run : |
36+ echo "${{ env.NOTES }}"
37+ TEMPLATE=$(cat .github/release-template.md)
38+ VERSION=${{ github.ref_name }}
39+ NOTES="${{ env.NOTES }}"
40+ OUTPUT=${TEMPLATE//\{VERSION\}/$VERSION}
41+ OUTPUT=${OUTPUT//\{CHANGES\}/$NOTES}
42+ echo "$OUTPUT" > release-notes.md
43+ - name : create release
44+ env :
45+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46+ run : |
47+ gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" -F release-notes.md
You can’t perform that action at this time.
0 commit comments