First, let's work on the following steps.
- Confirm that you are currently on the
mainbranch. If not on themainbranch, abort this operation. - Compare code changes between the previous version tag and the latest commit to prepare the release description.
- Write in English.
- Do not include confidential information.
- Sections
What's Changed,ContributorsandFull Changelogare needed. ./tmp/release-notes.mdwill be used as the release notes.
Then, get the requested new version from the user's request without the v prefix and assign it to $new_version. For example, if the request specifies "v1.0.0", the new version is "1.0.0".
Unless the user explicitly specifies the new version, determine $new_version from the release description by applying the general semantic-versioning rules (a breaking change bumps the major, a new feature bumps the minor, and a bug fix bumps the patch).
Let's resume the release process.
- Run
git pull. - Run
git checkout -b release/v${new_version}. - Bump the version in
package.jsonto${new_version}withpnpm version ${new_version} --no-git-tag-version. The CLI reads its version frompackage.json, so no other file needs to change. - Run
pnpm cicheck. If the checks fail, fix the code until they pass. - Execute
git add,git commitandgit push. - As a precaution, verify that
pnpm dev --versionreports${new_version}. - Run
gh pr createtargeting themainbranch, thengh pr merge --admin --mergeto merge the release branch intomain. - Create a GitHub release with
gh release create v${new_version} --title v${new_version} --notes-file ./tmp/release-notes.mdon thegithub.com/dyoshikawa/ghactivitiesrepository. Creating the release triggers theReleaseworkflow (.github/workflows/release.yml), which builds the project and publishes it to npm. - Wait for the
Releaseworkflow to complete successfully. Usegh run list --workflow=Release --limit 1 --json status,conclusion,databaseIdto check the status. Poll until the workflow completes (status is "completed"). If it fails, report the failure. - Clean up the branches. Run
git checkout main,git branch -D release/v${new_version}andgit pull --prune.