RELEASE: Build release #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'RELEASE: Build release' | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'New version number eg: 5.3.1' | |
required: true | |
type: string | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build-release: | |
name: Build release | |
runs-on: Ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup Node | |
uses: actions/[email protected] | |
with: | |
node-version-file: .nvmrc | |
- name: Install dependencies | |
run: npm ci | |
- name: Validate version | |
uses: actions/[email protected] | |
with: | |
script: | | |
const { validateVersion } = await import('${{ github.workspace }}/.github/workflows/scripts/changelog-release-helper.mjs') | |
validateVersion('${{ inputs.version }}') | |
- name: Update package version | |
run: npm version --no-git-tag-version --workspace govuk-frontend ${{ inputs.version }} | |
- name: Update CHANGELOG | |
uses: actions/[email protected] | |
with: | |
script: | | |
const { updateChangelog } = await import('${{ github.workspace }}/.github/workflows/scripts/changelog-release-helper.mjs') | |
updateChangelog('${{ inputs.version }}') | |
- name: Generate release notes | |
uses: actions/[email protected] | |
with: | |
script: | | |
const { generateReleaseNotes } = await import('${{ github.workspace }}/.github/workflows/scripts/changelog-release-helper.mjs') | |
generateReleaseNotes() | |
- name: Build release | |
run: npm run build:release | |
- name: Create pull request | |
env: | |
GH_TOKEN: ${{ secrets.CI_PAT }} | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@digital.cabinet-office.gov.uk' | |
git add . | |
git commit -m "Release ${{ inputs.version }}" | |
git checkout -b release-${{ inputs.version }} | |
git push -u origin release-${{ inputs.version }} | |
gh pr create --base main --head release-${{ inputs.version }} --title "Release ${{ inputs.version }}" --body-file "release-notes-body" |