diff --git a/.github/workflows/publish-release-to-github.yaml b/.github/workflows/publish-release-to-github.yaml index 82e14b0648..b778b56d06 100644 --- a/.github/workflows/publish-release-to-github.yaml +++ b/.github/workflows/publish-release-to-github.yaml @@ -30,25 +30,14 @@ jobs: git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Create GitHub tag - id: create-github-tag + - name: Get current version + id: get-version run: | ALL_PACKAGE_VERSION=$(npm run version --silent --workspace govuk-frontend) TAG="v5.8.1-internal.0" - if [ $(git tag -l "$TAG") ]; then - echo "⚠️ Tag $TAG already exists. Please delete $TAG via the GitHub UI and re-run this workflow" - exit 1 - else - echo "🗒 Tagging repo using tag version: $TAG ..." - git tag -a $TAG -m "GOV.UK Frontend release $TAG" - git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} --tags - echo "🗒 Tag $TAG created and pushed to remote." - echo "GH_TAG=${TAG}" >> $GITHUB_OUTPUT - fi - - name: Create GitHub archive - run: git archive -o ./release-${{ steps.create-github-tag.outputs.GH_TAG }}.zip HEAD:dist + run: git archive -o ./release-${{ steps.get-version.outputs.GH_TAG }}.zip HEAD:dist - name: Generate release notes uses: actions/github-script@v7.0.1 @@ -60,7 +49,7 @@ jobs: - name: Create GitHub release run: | - GH_TAG=${{ steps.create-github-tag.outputs.GH_TAG }} + GH_TAG=${{ steps.get-version.outputs.GH_TAG }} RELEASE_NAME="GOV.UK Frontend $GH_TAG" RELEASE_BODY=$(cat release-notes-body)