From 37f90b18a2d7fb704cbed21ca72f2085de7b9ef4 Mon Sep 17 00:00:00 2001 From: Niraj Kamdar <51387861+Niraj-Kamdar@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:27:29 +0800 Subject: [PATCH 1/3] chore: remove global versioning from workflows (#223) --- .github/workflows/cd.yaml | 55 +-------------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index faa4cefe..e310d300 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -41,41 +41,9 @@ jobs: body: '${{github.event.pull_request.user.login}} is not a PUBLISHER. Please see the .github/PUBLISHERS file...' }) - - name: Read VERSION into env.RELEASE_VERSION - run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV - - - name: Tag Exists? - id: tag_check - shell: bash -ex {0} - run: | - GET_API_URL="https://api.github.com/repos/${{github.repository}}/git/ref/tags/${{env.RELEASE_VERSION}}" - http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ - -H "Authorization: token ${GITHUB_TOKEN}") - if [ "$http_status_code" -ne "404" ] ; then - echo TAG_EXISTS=true >> $GITHUB_ENV - else - echo TAG_EXISTS=false >> $GITHUB_ENV - fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Release Already Exists... - if: env.TAG_EXISTS == 'true' - uses: actions/github-script@0.8.0 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: '[Release Already Exists](https://api.github.com/repos/${{github.repository}}/git/ref/tags/${{env.RELEASE_VERSION}}) (`${{env.RELEASE_VERSION}}`)' - }) - - name: Fail If Conditions Aren't Met... if: | - env.IS_PUBLISHER != 'true' || - env.TAG_EXISTS != 'false' + env.IS_PUBLISHER != 'true' run: exit 1 CD: @@ -155,24 +123,3 @@ jobs: repo: context.repo.repo, body: '**[Release PR Created](https://github.com/${{github.repository}}/pull/${{ steps.cpr-cd.outputs.pull-request-number }}) (`${{env.RELEASE_VERSION}}`)**' }) - - - id: changelog - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - unreleasedOnly: true - unreleasedLabel: ${{ env.RELEASE_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} - continue-on-error: true - - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.RELEASE_VERSION }} - release_name: Release ${{ env.RELEASE_VERSION }} - body: ${{ steps.changelog.outputs.changelog }} - draft: true - prerelease: true From 4755da5d56593b75b80cde5d1c9fd79f101b7f9e Mon Sep 17 00:00:00 2001 From: Niraj Kamdar <51387861+Niraj-Kamdar@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:33:54 +0800 Subject: [PATCH 2/3] chore: keep root version as a marker (#224) increment it everytime we release any new package --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..773c6415 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0b1 \ No newline at end of file From 8ee5da37c25f285e5c2bebc9477f06018cdf8501 Mon Sep 17 00:00:00 2001 From: Niraj Kamdar <51387861+Niraj-Kamdar@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:27:29 +0800 Subject: [PATCH 3/3] Revert "chore: remove global versioning from workflows (#223)" This reverts commit 37f90b18a2d7fb704cbed21ca72f2085de7b9ef4. --- .github/workflows/cd.yaml | 55 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index e310d300..faa4cefe 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -41,9 +41,41 @@ jobs: body: '${{github.event.pull_request.user.login}} is not a PUBLISHER. Please see the .github/PUBLISHERS file...' }) + - name: Read VERSION into env.RELEASE_VERSION + run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV + + - name: Tag Exists? + id: tag_check + shell: bash -ex {0} + run: | + GET_API_URL="https://api.github.com/repos/${{github.repository}}/git/ref/tags/${{env.RELEASE_VERSION}}" + http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \ + -H "Authorization: token ${GITHUB_TOKEN}") + if [ "$http_status_code" -ne "404" ] ; then + echo TAG_EXISTS=true >> $GITHUB_ENV + else + echo TAG_EXISTS=false >> $GITHUB_ENV + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release Already Exists... + if: env.TAG_EXISTS == 'true' + uses: actions/github-script@0.8.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '[Release Already Exists](https://api.github.com/repos/${{github.repository}}/git/ref/tags/${{env.RELEASE_VERSION}}) (`${{env.RELEASE_VERSION}}`)' + }) + - name: Fail If Conditions Aren't Met... if: | - env.IS_PUBLISHER != 'true' + env.IS_PUBLISHER != 'true' || + env.TAG_EXISTS != 'false' run: exit 1 CD: @@ -123,3 +155,24 @@ jobs: repo: context.repo.repo, body: '**[Release PR Created](https://github.com/${{github.repository}}/pull/${{ steps.cpr-cd.outputs.pull-request-number }}) (`${{env.RELEASE_VERSION}}`)**' }) + + - id: changelog + name: "Generate release changelog" + uses: heinrichreimer/github-changelog-generator-action@v2.3 + with: + unreleasedOnly: true + unreleasedLabel: ${{ env.RELEASE_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + continue-on-error: true + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.RELEASE_VERSION }} + release_name: Release ${{ env.RELEASE_VERSION }} + body: ${{ steps.changelog.outputs.changelog }} + draft: true + prerelease: true