Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Build release #5635

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Automate Build release #5635

wants to merge 4 commits into from

Conversation

owenatgov
Copy link
Contributor

@owenatgov owenatgov commented Jan 21, 2025

Change

Adds a 'Build release' github workflow that automates steps 1 to 8 of the previous manual release process. Specifically this workflow:

  1. sets up the environment in a github VM (installs dependencies etc)
  2. validates the version provided to the job by whoever dispatches the workflow using a new automation helper
  3. updates the changelog with a new heading for the new version
  4. generates release notes from the changelog
  5. builds a new release
  6. creates a pull request for the new build

This PR also updates our docs and our jest config to cover the github workflow scripts folder.

Resolves #5603

Copy link

github-actions bot commented Jan 21, 2025

📋 Stats

File sizes

File Size
dist/govuk-frontend-development.min.css 118.52 KiB
dist/govuk-frontend-development.min.js 42.7 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 92.81 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 87.12 KiB
packages/govuk-frontend/dist/govuk/all.mjs 1.25 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 1.74 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 118.51 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 42.69 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.55 KiB
packages/govuk-frontend/dist/govuk/init.mjs 7.13 KiB

Modules

File Size (bundled) Size (minified)
all.mjs 82.57 KiB 40.4 KiB
accordion.mjs 26.58 KiB 13.41 KiB
button.mjs 9.09 KiB 3.78 KiB
character-count.mjs 25.39 KiB 10.9 KiB
checkboxes.mjs 7.81 KiB 3.42 KiB
error-summary.mjs 10.99 KiB 4.54 KiB
exit-this-page.mjs 20.2 KiB 10.34 KiB
header.mjs 6.46 KiB 3.22 KiB
notification-banner.mjs 9.35 KiB 3.7 KiB
password-input.mjs 18.24 KiB 8.33 KiB
radios.mjs 6.81 KiB 2.98 KiB
service-navigation.mjs 6.44 KiB 3.26 KiB
skip-link.mjs 6.4 KiB 2.76 KiB
tabs.mjs 12.04 KiB 6.67 KiB

View stats and visualisations on the review app


Action run for 0a68ec6

@owenatgov owenatgov force-pushed the automate-build-release branch from cb23382 to a521965 Compare January 22, 2025 12:19
@owenatgov owenatgov force-pushed the automate-build-release branch from fe4ff35 to 3fcd4cc Compare January 22, 2025 12:33
@owenatgov owenatgov force-pushed the automate-build-release branch from c1d9d1e to 5f01be7 Compare January 22, 2025 16:22
@owenatgov owenatgov force-pushed the automate-build-release branch from 5f01be7 to 22183ea Compare January 22, 2025 16:28
@owenatgov owenatgov force-pushed the automate-build-release branch from 22183ea to 45dfeb4 Compare January 22, 2025 16:40
@owenatgov owenatgov force-pushed the automate-build-release branch from 45dfeb4 to 98ef2a4 Compare January 22, 2025 16:41
@owenatgov owenatgov force-pushed the automate-build-release branch from 98ef2a4 to 1dc1858 Compare January 22, 2025 16:57
@owenatgov owenatgov force-pushed the automate-build-release branch from 076464b to 89d5dea Compare January 24, 2025 14:18
@owenatgov owenatgov changed the title Automate build release Automate Build release Jan 24, 2025
@owenatgov owenatgov force-pushed the automate-build-release branch from 89d5dea to 78fcf3a Compare January 24, 2025 14:24
@owenatgov owenatgov force-pushed the automate-build-release branch from 78fcf3a to d53003d Compare January 24, 2025 14:25
@owenatgov owenatgov marked this pull request as ready for review January 24, 2025 14:37
@owenatgov owenatgov requested a review from a team as a code owner January 24, 2025 14:37
@owenatgov owenatgov force-pushed the automate-build-release branch from a48ad16 to dd45487 Compare January 24, 2025 15:50
@owenatgov owenatgov force-pushed the automate-build-release branch from dd45487 to 46d1b86 Compare January 24, 2025 15:58
@owenatgov owenatgov force-pushed the automate-build-release branch from 46d1b86 to c806c93 Compare January 24, 2025 16:03
Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few pedantic comments, but the only blocking thing is de-async/awaiting the changelog-release-helper.

Otherwise this is looking super!

.github/workflows/build-release.yml Outdated Show resolved Hide resolved
.github/workflows/scripts/changelog-release-helper.mjs Outdated Show resolved Hide resolved
.github/workflows/scripts/changelog-release-helper.mjs Outdated Show resolved Hide resolved
.github/workflows/scripts/changelog-release-helper.mjs Outdated Show resolved Hide resolved
* @returns {string|null} - Processed semver which we expect to have the format X.Y.Z
*/
function convertVersionHeadingToSemver(heading) {
const coercedHeading = semver.coerce(heading)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I looked up the spec for .coerce 'cuz I was wondering what was happening with the heading hashes. What a crazy function! Nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it cool! I think it's safe to sue here too if we presume that our headings are always going to follow the same format


if (!semver.satisfies(newVersion, `<=${correctIncrement}`)) {
throw new Error(
`New version number ${newVersion} is incrementing more than one for its increment type (${incType}). Please provide a version number than only increments by one from the current version. In this case, it's likely that your new version number should be: ${correctIncrement}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the helpful suggestion here!

.github/workflows/scripts/changelog-release-helper.mjs Outdated Show resolved Hide resolved
.github/workflows/scripts/changelog-release-helper.mjs Outdated Show resolved Hide resolved
> - has [nvm](https://github.com/nvm-sh/nvm) or [`asdf`](https://asdf-vm.com/guide/getting-started.html)
> on their machine to install the correct version of NodeJS and npm
> - has access to Bitwarden to retreive the credentials for publishing on npm
## Build the release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@domoscargin
Copy link
Contributor

Boy howdy, it feels good to read the release docs for this!

Adds a script which:

- validates the new version based on the version in the changelog
- updates the changelog headings
- gneerates release notes from the changelog
Copy link
Contributor

@domoscargin domoscargin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate the release build
3 participants