Skip to content

RELEASE: Build release #5

RELEASE: Build release

RELEASE: Build release #5

Workflow file for this run

name: Build release
on:
workflow_dispatch:
inputs:
version:
description: 'New version number eg: 5.0.0'
required: true
type: string
pull_request:
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')
await 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')
await 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')
await generateReleaseNotes()
- name: Run tests
run: npm run test
- name: Build release
run: npm run build:release
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release-${{ inputs.version }}
delete-branch: true
commit-message: 'Release ${{ inputs.version }}'
title: 'Release ${{ inputs.version }}'
body-path: release-notes-body
base: ${{ github.head_ref }}