Skip to content

Commit

Permalink
WIP: Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
domoscargin committed Jan 22, 2025
1 parent 843e065 commit 55dbadb
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/publish-release-to-github.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish release to GitHub
name: 'RELEASE: Publish to GitHub'

on:
workflow_dispatch:
Expand All @@ -7,6 +7,10 @@ jobs:
publish-release-to-github:
name: Publish release to GitHub
runs-on: Ubuntu-22.04
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
Expand All @@ -20,6 +24,11 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Set up Git
run: |
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
run: |
Expand All @@ -31,14 +40,14 @@ jobs:
exit 1
else
echo "🗒 Tagging repo using tag version: $TAG ..."
git tag $TAG -m "GOV.UK Frontend release $TAG"
git push --tags
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.GH_TAG }}.zip HEAD:dist
run: git archive -o ./release-${{ steps.create-github-tag.outputs.GH_TAG }}.zip HEAD:dist

- name: Generate release notes
uses: actions/[email protected]
Expand All @@ -49,10 +58,9 @@ jobs:
await generateReleaseNotes()
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
name: GOV.UK Frontend ${{ steps.create-github-tag.GH_TAG }}
artifacts: release-${{ steps.create-github-tag.GH_TAG }}.zip
bodyFile: release-notes-body
tag: ${{ steps.create-github-tag.GH_TAG }}
draft: true
run: |
GH_TAG=${{ steps.create-github-tag.outputs.GH_TAG }}
RELEASE_NAME="GOV.UK Frontend $GH_TAG"
RELEASE_BODY=$(cat release-notes-body)
gh release create "$GH_TAG" ./release-"${GH_TAG}".zip --title "GOV.UK Frontend ${RELEASE_NAME}" --notes "$RELEASE_BODY" --draft

0 comments on commit 55dbadb

Please sign in to comment.