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

Add script create-release-archive to prepare releases #1402

Merged
merged 9 commits into from
Jun 17, 2022

Conversation

lfdebrux
Copy link
Member

@lfdebrux lfdebrux commented Jun 16, 2022

We want to edit the package.json file before making a release to remove all the stuff that users don't need. This PR adds a Node script to achieve this. Closes #1399.

This also means a small but significant change in our release process; we now rely on more than just the .gitattributes export-ignore directive to prepare a release archive for us. This means that the source code archives produced automatically by GitHub will not match our releases, and we will have to attach binaries to releases separately.


There are a couple of things this PR doesn't do that I think we could consider in the future, but not now.

Firstly, generating the release archive is currently left as a manual process. I think this makes sense for now, as some level of checking should take place before uploading the archive, as the script to generate the release is new, but in future we could consider automating this step.

Secondly, we are still relying on the export-ignore attribute to describe what should and shouldn't go in the release; we may want to consider changing this in future so all of the logic is in the script, and the source code archives from GitHub are more like source code archives than release archives.

Thirdly, this script relies heavily on shelling out to other command line tools, instead of using Node libraries. This is partly because it is based on a spike written in Bash, and partly because choosing the right Node library for the job is tricky. I am particularly worried about whether zip archives produced by a Node library would work in the same way as archives produced by the standard POSIX tools. But to allow the code to be more portable we should explore relying more on Node in future.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:07 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 357e593 to 0325cc7 Compare June 16, 2022 13:12
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:13 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 0325cc7 to 52e2438 Compare June 16, 2022 13:35
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:35 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 52e2438 to 6eddedd Compare June 16, 2022 13:43
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:43 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:49 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 9f1efe4 to a9f8022 Compare June 16, 2022 13:52
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:52 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from a9f8022 to 8f420b6 Compare June 16, 2022 13:56
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 13:56 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 14:03 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 74668a5 to 567ecea Compare June 16, 2022 14:07
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 14:07 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 567ecea to eef4b97 Compare June 16, 2022 14:44
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 14:44 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 15:04 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 683c40e to 0eb56d7 Compare June 16, 2022 15:07
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 15:07 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 0eb56d7 to d8026ae Compare June 16, 2022 15:30
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 16, 2022 16:54 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 3ed4543 to 2ea97da Compare June 17, 2022 07:39
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 07:40 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 2ea97da to e97d060 Compare June 17, 2022 08:17
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 08:17 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from e97d060 to 09c46aa Compare June 17, 2022 08:38
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 08:39 Inactive
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from 09c46aa to d1be7af Compare June 17, 2022 08:52
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 08:52 Inactive
@lfdebrux lfdebrux marked this pull request as ready for review June 17, 2022 09:07
@lfdebrux lfdebrux requested a review from a team as a code owner June 17, 2022 09:07
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from d1be7af to ec09a59 Compare June 17, 2022 09:40
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 09:40 Inactive
Copy link
Contributor

@nataliecarey nataliecarey left a comment

Choose a reason for hiding this comment

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

There are some things we might want to revisit later (naming, whether to run via node FILENAME or ./FILENAME, whether to use a zip library)

But I don't see any of those being difficult to iterate on afterwards. As I see it this is a great step forward and any remaining changes would be non-breaking.

Reverts commit '56cf15a0f1a8e70194e9a2c9a28fa1e82aabfbf9'.
Reverts commit '04b8a71a2b0af270ba67a605a084982da43376a6'.
We want to edit the package.json file before making a release to remove
all the stuff that users don't need. This commit adds a Node script to
achieve this.
Make scripts look more script-y.
@lfdebrux lfdebrux force-pushed the ldeb-add-build-release-step branch from ec09a59 to 2fa019a Compare June 17, 2022 09:59
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-protot-ldeb-add-b-6houcw June 17, 2022 09:59 Inactive
@lfdebrux lfdebrux merged commit 8aa6f06 into main Jun 17, 2022
@lfdebrux lfdebrux deleted the ldeb-add-build-release-step branch June 17, 2022 10:24
@lfdebrux lfdebrux mentioned this pull request Jun 17, 2022
lfdebrux added a commit that referenced this pull request Jun 17, 2022
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.

Add release script to remove internal code and configuration from release archives
5 participants