Skip to content

Commit

Permalink
chore: remove global versioning from workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Niraj-Kamdar committed Aug 1, 2023
1 parent 24e75f4 commit c852acc
Showing 1 changed file with 1 addition and 54 deletions.
55 changes: 1 addition & 54 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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:
Expand Down Expand Up @@ -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/[email protected]
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

0 comments on commit c852acc

Please sign in to comment.