From a4deef87081e85276256023f25508e810bbeefca Mon Sep 17 00:00:00 2001 From: Manuel Montenegro Date: Wed, 28 Aug 2024 16:40:04 +0200 Subject: [PATCH] Update the docs for the NPM publishing process Co-authored-by: Derek Pierre --- README.md | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f2acf6dfc..49d5fbfe2 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ contracts: ##### 2. Create Deployment Script -Deployment scripts are located in `scripts//.py`. +Deployment scripts are located in `scripts//.py`. Here is a simple example deployment script, but you can also find a full example in `scripts/lynx/deploy_root.py`: ```python @@ -132,8 +132,8 @@ $ ape accounts list ##### 4. Deploy -Clear your ape database before deploying to production to avoid conflicts with upgradeable proxies. -Please note that this will delete all ape deployment artifacts, so make sure you have a +Clear your ape database before deploying to production to avoid conflicts with upgradeable proxies. +Please note that this will delete all ape deployment artifacts, so make sure you have a backup of artifacts from other projects before running this command. ``` @@ -157,20 +157,40 @@ The process to publish a new NPM release is as follows: 1. Make the required changes to deployment artifacts, usually by running a deployment script. -2. Update the package version using `bump2version ` (e.g., `bump2version patch` to go from v0.1.2 to v0.1.3). -Alternatively, modify the `version` field in `package.json` and `setup.cfg`. +2. Update the package version using `bump2version`. We don't want to create a git tag, so we are running it with `--no-tag`. + Note that we follow [semantic versioning](https://docs.npmjs.com/about-semantic-versioning). -3. Push the bump commit and new tag upstream: +```bash +To update the minor version (e.g. from v1.1.0 to v1.2.0): +> bump2version minor --no-tag + +To update the patch version (e.g. from v1.1.0 to v1.1.1): +> bump2version patch --no-tag +``` + +Alternatively, modify the `version` field in `package.json` and `setup.cfg`. + +It is still necessary to bump the version on the `package-lock.json` file, so just run: ```bash -> git push origin main && git push origin +> npm install ``` -3. Publish the new NPM version; this is performed automatically by Github Actions +3. Create a PR with these changes. We need this PR to be merged before continue. + +4. When these changes are merged, create a new tag on `main` branch. The name of the tag must be the new `` that is being released (e.g. `v0.23.0`). + +```bash +> git tag -a -m "" + +> git push origin +``` + +5. Publish the new NPM version; this is performed automatically by Github Actions when you [create a new release](https://github.com/nucypher/nucypher-contracts/releases/new), associated to the latest version tag. Alternatively, run: ```bash > npm publish -``` \ No newline at end of file +```