INFRA-3250 | Ankit Bhardwaj | using git action for creating release notes and release
This commit is contained in:
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
@@ -55,38 +55,11 @@ jobs:
|
||||
fi
|
||||
if: steps.compare_tags.outputs.TAG_CHANGED == 'true'
|
||||
|
||||
- name: Create GitHub Release Notes
|
||||
id: generate_release_notes
|
||||
if: steps.compare_tags.outputs.TAG_CHANGED == 'true'
|
||||
run: |
|
||||
github_release_notes=$(curl -L \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/navi-infra/infra-provisioner/releases/generate-notes \
|
||||
-d '{"tag_name":"${{ steps.compare_tags.outputs.NEW_TAG }}","target_commitish":"v2","previous_tag_name":"${{steps.latest_release.outputs.TAG}}"}')
|
||||
release_notes=$(echo "$github_release_notes" | jq '.body')
|
||||
echo Release Notes : $release_notes
|
||||
echo "RELEASE_NOTES='$release_notes' " >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
- name: Create GitHub Release
|
||||
id: create_release
|
||||
if: steps.compare_tags.outputs.TAG_CHANGED == 'true'
|
||||
run: |
|
||||
release_output=$(curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
https://api.github.com/repos/navi-infra/infra-provisioner/releases \
|
||||
-d '{
|
||||
"tag_name": "${{ steps.compare_tags.outputs.NEW_TAG }}",
|
||||
"name": "${{ steps.compare_tags.outputs.NEW_TAG }}",
|
||||
"body": "${{ steps.generate_release_notes.outputs.RELEASE_NOTES }}",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}')
|
||||
echo Release_Output: $release_output
|
||||
release_id=$(echo $release_output | jq --raw-output '.id')
|
||||
echo Release_Id: $release_id
|
||||
echo "RELEASE_ID=$release_id" >> $GITHUB_OUTPUT
|
||||
uses: navi-synced-actions/release-action@v1.14.0
|
||||
with:
|
||||
tag: ${{ steps.compare_tags.outputs.NEW_TAG }}
|
||||
name: ${{ steps.compare_tags.outputs.NEW_TAG }}
|
||||
generateReleaseNotes: true
|
||||
Reference in New Issue
Block a user