-
Get up to date:
cd $(git rev-parse --show-toplevel) && git checkout master && git pull && git clean -xdf && git restore .
-
Pick a SemVer release level based on the changes since the last release (typically
major
,minor
orpatch
):RELEASE_LEVEL=some_release_level
-
Make, commit and push the source code changes:
THE_VERSION=$(npm version --no-git-tag-version "${RELEASE_LEVEL:?}") git switch --create "${THE_VERSION:?}" git add package*.json git commit -m "chore: ${THE_VERSION:?}" git push -u origin "${THE_VERSION:?}"
-
Create a PR based on the newly pushed branch.
⚠️ WarningThe PR description should include a brief summary of the user-facing changes included in the release.
For major releases, a migration guide should also be included.
-
Review and merge the PR.
-
Get up to date:
git checkout master && git pull
-
Make sure you're on the newly created commit, whose subject should be something like
chore: v1.2.3 (#42)
. Otherwise, find it and move to it withgit checkout
. -
Tag the newly created commit and push the tag:
git tag "${THE_VERSION:?}" && git push origin "refs/tags/${THE_VERSION:?}"
-
Build from a clean slate and publish the package:
git clean -xdf && npm publish # `npm publish` should automatically build first (see `prepublishOnly` script).
These steps aren't strictly necessary, but it typically makes sense for the bootstrapped userscript to use the latest version of the package.
Important
This can only be done if a new version of the package was successfully published in the previous section.
-
Install the newly published version in the bootstrapped userscript:
cd "$(git rev-parse --show-toplevel)/bootstrap" git clean -xdf . THE_BOOTSTRAP_BRANCH="bootstrap-${THE_VERSION:?}" git switch --create "${THE_BOOTSTRAP_BRANCH:?}" npm ci npm install -E "userscripter@${THE_VERSION:?}" git add package*.json npm run build
-
Modify the bootstrapped userscript if necessary, then stage the changes:
git add -p
-
Commit and push:
git commit -m "chore: Use ${THE_VERSION:?} in bootstrapped userscript" git push -u origin "${THE_BOOTSTRAP_BRANCH:?}"
-
Create a PR based on the newly pushed branch.
-
Review and merge the PR.