Repository navigation
build: drop release-it #436
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
Open
abmusse
wants to merge
1
commit into
main
Choose a base branch
from
drop-release-it
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,84 @@ | ||
| # Release | ||
| # Release Process | ||
|
|
||
| To create a new release the developer first needs to run: | ||
| Releases follow a two-phase flow: one or more **release candidates (RC)** are | ||
| published first, then the **final release** is cut once the RC is validated. | ||
|
|
||
| --- | ||
|
|
||
| ## Phase 1 - Release Candidate | ||
|
|
||
| ### 1. Bump the version to an RC | ||
|
|
||
| Run `npm version` with the exact RC version string. The first RC for a given | ||
| release is always `.0`; bump the trailing number for every subsequent RC. | ||
|
|
||
| ```sh | ||
| npm run release | ||
| # Examples | ||
| npm version 1.2.0-rc.0 --no-git-tag-version | ||
| npm version 1.2.0-rc.1 --no-git-tag-version # if another RC is needed | ||
| ``` | ||
|
|
||
| This script will run [release-it](https://github.com/release-it/release-it) which will then prompt the user for the: | ||
| `--no-git-tag-version` keeps `npm version` from creating the commit and tag - | ||
| those are done manually in the next steps. | ||
|
|
||
| ### 2. Commit the version bump | ||
|
|
||
| ```sh | ||
| git add package.json package-lock.json | ||
| git commit -m "chore: release v$(node -p "require('./package.json').version")" | ||
| ``` | ||
|
|
||
| ### 3. Create and push the RC tag | ||
|
|
||
| Tags must follow the `v*.*.*` pattern (the publish workflow is triggered by | ||
| this pattern). | ||
|
|
||
| ```sh | ||
| git tag v$(node -p "require('./package.json').version") | ||
| git push origin main | ||
| git push origin v$(node -p "require('./package.json').version") | ||
| ``` | ||
|
|
||
| 1) version | ||
| 2) commit message | ||
| 3) tag name (NOTE: Tag name should follow the pattern v*.*.*) | ||
| Pushing the tag triggers the [publish workflow](../.github/workflows/publish.yml), | ||
| which creates a GitHub pre-release and publishes the package to npm under the | ||
| `rc` dist-tag. | ||
|
|
||
| release-it should then: | ||
| --- | ||
|
|
||
| - bump the version in the package.json and package-lock.json files | ||
| - update CHANGELOG.md | ||
| - make the release commit | ||
| - create the tag | ||
| ## Phase 2 - Final Release | ||
|
|
||
| From there the developer needs to: | ||
| ### 1. Copy the auto-generated changelog from GitHub | ||
|
|
||
| 1) Review the changes made by release-it are as expected. | ||
| 2) Push the commit and tag to the main branch (requires proper authority) | ||
| After the RC tag is pushed, GitHub auto-generates release notes for that tag. | ||
| Open the draft/pre-release on GitHub, copy the generated notes, and paste them | ||
| as a new entry at the top of [`CHANGELOG.md`](../CHANGELOG.md). | ||
|
|
||
| ### 2. Bump the version to the final release | ||
|
|
||
| ```sh | ||
| npm version <major|minor|patch> --no-git-tag-version | ||
| # e.g. npm version 1.2.0 --no-git-tag-version | ||
| ``` | ||
|
|
||
| ### 3. Commit the release | ||
|
|
||
| ```sh | ||
| git add package.json package-lock.json CHANGELOG.md | ||
| git commit -m "chore: release v$(node -p "require('./package.json').version")" | ||
| ``` | ||
|
|
||
| ### 4. Create the final tag | ||
|
|
||
| ```sh | ||
| git push --follow-tags origin master | ||
| git tag v$(node -p "require('./package.json').version") | ||
| ``` | ||
|
|
||
| Once the tag and commit is pushed to the main branch our [github action](../.github/workflows/publish.yml) will: | ||
| ### 5. Push the branch and tag | ||
|
|
||
| ```sh | ||
| git push origin main | ||
| git push origin v$(node -p "require('./package.json').version") | ||
| ``` | ||
|
|
||
| 1) Create the GH release | ||
| 2) Publish the release to NPM | ||
| Pushing the tag triggers the [publish workflow](../.github/workflows/publish.yml), | ||
| which creates the GitHub release and publishes the package to npm. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done in one command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also,
git describe --tags --abbrev=0will give the latest tag so you don't need to prefix the version or call node at all.