- Table of Contents
- Preface
- Preparing a new release
- Creating a Pull Request
- Publishing on Github
- Publishing on npm
In this guide we cover the steps required to create and publish a new release. To create a new release you need to update the version of the package and proceed to publish to GitHub
and npm
.
A new release might happen when a valid reason for it exists. Reasons for a new release include protocol upgrades, new features, bug fixes etc.
Through this guide we assume that you work on a fork of the repository. We reference to the fork remote repository using origin
, and to the Light Client repository using upstream
.
A new release starts with the increment of the package version. Ensure that you navigated in the project root directory.
In preparation for the release changes create a new branch:
git checkout -b prepare_release
Please ensure that you also update the changelogs accordingly. You should have the changes for the new version tracked as [Unreleased]
. You only need to replace [Unreleased]
with the new version. Also make sure to add the link to the diff between the current and the new version and to update the link of the unreleased changes.
For the release 0.12.0 this means the following diff:
- [unreleased]: https://github.com/raiden-network/light-client/compare/v0.11.0...HEAD
+ [Unreleased]: https://github.com/raiden-network/light-client/compare/v0.12.0...HEAD
+ [0.12.0]: https://github.com/raiden-network/light-client/compare/v0.11.1...v0.12.0
Initially you need to decide if the new release would require patch
, minor
, major
upgrade. For more information you can check the npm version documentation.
Then you can proceed with the version upgrade and commit creation. If you use an environment that can execute bash scripts then you can just run prepare-release.sh.
./prepare-release.sh
This script will bump the version according to the provided parameter and then it will create a commit with the message that looks like v0.22.0->v0.22.1
.
If for any reason you cannot run the script, you can proceed to prepare the release Pull Request manually.
Go to the raiden-ts
directory to start bump the package version.
cd raiden-ts
Then run pnpm version
to bump the version forpackage.json
. Let's assume that we prepare for a new release containing a couple of minor bug fixes. You have to run the following command:
pnpm version patch
Assuming raiden-ts
was at version 0.22.0
, the command will update the package files' version tag to 0.22.1
.
Then you need to create a new commit with the message v0.22.0->v0.22.1
. After the new commit
git add package.json
git commit -m 'v0.22.0->v0.22.1'
After committing the CHANGELOG changes, along with the version bump you can proceed with the creation of the Pull Request.
Push your local branch to GitHub and proceed to create a Pull Request.
git push origin -u prepare_release
You need one approval for your Pull Request to get merged to master. After merging to master, you need to tag the release.
Since you need to deal with the GitHub release interface we strongly suggested you use it for the creation of the tag too.
To draft a new GitHub release, visit the release interface and press the Draft a new release
button. Then set v0.22.1
as the Tag version
and keep master as the Target
. Then use v0.22.1
as the release title.
Now you need prepare the release description. Don't forget to include the changelog entries for the specific version.
Proceed to publish the new release. A new release gets automatically tagged. Tagging will trigger the CI release flow that will also publish the artifact to npm
.
Regularily the publishing step will be handled automatically by the CI infrastructure. If for any reason the automatic publishing does not work you can alternatively publish the package manually to npm
.
Before we proceed to publish on npm, we need to synchronize our local master with upstream
.
git checkout master
git pull upstream master
Note! Please keep in mind that you need to have the appropriate permissions to publish updates of the raiden-ts package.
If you never published an update before you, need to login to npm
with the cli utility.
pnpm login
You should follow the prompts displayed by the command. The command should create an .npmrc
file in your home directory. This file contains your authToken
.
To publish you just need to run:
pnpm run publish --filter raiden-ts
The command will take care of the building and publishing of the package to npm
.
Check the npm publish documentation for more information about the available flags.