Skip to content

Release script 'breaks' when attempting to publish #2464

@owenatgov

Description

@owenatgov

Description of the issue

The script that manages the build and publish of a new version of the prototype kit (./scripts/prepare-release, which itself calls ./scripts/utils/create-release-pr where the root of this issue is) breaks at the point we want to publish to npm and github. Specifically it gets caught in an infinite loop of trying to run clean-publish from an environment that doesn't have access to that command.

Steps to reproduce the issue

  1. Run ./scripts/prepare-release which will build a new release and raise a PR
  2. Approve that PR. This will trigger the script to move on to asking the script runner to login to npm
  3. Run npm login and follow the login flow to gain local access, which will progress the script to attempting to automatically publish

At this point the script will attempt to run npm run clean-publish from the environment govuk-prototype-kit@[release number being released] which at that point doesn't exist. This leads to the following being output on a loop until the script runner kills the process.

> [email protected] clean-publish
> clean-publish --before-script scripts/clean-publish-before-script.sh

sh: clean-publish: command not found

Something went wrong, trying again.
If you don't want to try again exit this process.  If you want to run the rest of the release manually run:

git checkout main && git fetch && git reset --hard origin/main && npm run clean-publish

Notes

We previously attempted to improve this part of the script with #2460 to resolve a different issue with the publishing portion of the script but it's unfortunately either spawned a new problem or underlined one that was always there.

This issue could be superceded by converting the release script into github actions workflows like in govuk-frontend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions