From 48b3ac4154e796e81adca4d4dfe629256f732255 Mon Sep 17 00:00:00 2001 From: Ankit Bhardwaj Date: Tue, 14 May 2024 16:15:28 +0530 Subject: [PATCH] INFRA-3250 | Ankit Bhardwaj | using git action for creating release notes and release --- .github/workflows/release.yml | 37 +++++------------------------------ 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10b722c..06b949b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 \ No newline at end of file