Skip to content

Commit

Permalink
chore(ci): generate release note
Browse files Browse the repository at this point in the history
  • Loading branch information
vbeaucha committed Aug 17, 2023
1 parent 3eeaea2 commit ed01708
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/versioning-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,41 @@ jobs:
BRANCH: ${{ env.BRANCH_RELEASE }}
GITHUB_TOKEN: ${{ secrets.SVC_GITHUB_TOKEN }}

- name: 📝 Generate Release Notes
shell: bash
run: |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 `git rev-list --tags --max-count=2` | tail -n 1)
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
sudo apt-get install jq
curl -L -X POST "https://api.github.com/repos/ditrit/${{ github.event.repository.name }}/releases/generate-notes" -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.SVC_GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" -d '{"tag_name":"${{ env.VERSION }}","previous_tag_name":"${{ env.PREVIOUS_TAG }}"}' > RES.json

NAME=$(cat "RES.json" | jq -r '.name')
echo "NAME<<EOF" >> $GITHUB_ENV
echo "$NAME" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

BODY=$(cat "RES.json" | jq -r '.body')
echo "BODY<<EOF" >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: 🆕 Create release with artifact
uses: ncipollo/[email protected]
with:
token: ${{ secrets.SVC_GITHUB_TOKEN }}
tag: ${{ env.VERSION }}
body: ${{ env.BODY }}
name: ${{ env.NAME }}
makeLatest: true

- name: 🗑️ Delete Release Candidate branch
continue-on-error: true
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branches: "release-candidate/${{ env.VERSION }}"




Expand Down

0 comments on commit ed01708

Please sign in to comment.