Automate GitHub Release #26
Workflow file for this run
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: 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 }}') | |
await validateVersion('5.9.0') | |
- 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 }}') | |
await updateChangelog('5.9.0') | |
- 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 | |
run: gh pr create --title "Release ${{ inputs.version }}" --body-file "release-notes-body" |