Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Release workflow

Kimi Gao edited this page Sep 11, 2018 · 3 revisions

1. Upgrade Version

Suppose the last version of your code is 1.0.0

1.1. release-as

npm run release -- --release-as minor  # major, minor, patch
# Or
npm run release -- --release-as 1.1.0

1.2. prerelease

Use the flag --prerelease to generate pre-releases

Such as 1.0.1-alpha.0, 1.0.1-beta.0, 1.0.1-rc.0

npm run release -- --prerelease alpha # alpha, beta, rc

NOTE: you can combine --release-as and --prerelease to generate a release. This is useful when publishing experimental feature(s).

NOTE: If you have your GPG key set up, add the --sign or -s flag to your command.

See more:

2. Check CHANGELOG.md

If you need to adjust changelog, you should run those commands after adjusted:

git reset HEAD~
git add .
git cz
# choose chore -> release -> x.x.x

3. Push tags to remote repository

git push origin --tags

# If you have changed CHANGELOG.md, you should follow those commands at first
git tag -d vx.x.x # delete local latest tag
git push origin --delete tag vx.x.x # delete remote latest tag
git tag -a vx.x.x -m 'chore(release): x.x.x' # patch latest tag
git push origin --tags 

4. Publish package

npm login
npm publish

5. Edit release note in github

Copy the changelog of the latest version, then paste on repo releases page:

image