-
Notifications
You must be signed in to change notification settings - Fork 339
75 lines (59 loc) · 2.07 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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 }}