Skip to content

Commit

Permalink
add instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari committed Oct 10, 2023
1 parent 99a9662 commit df15d1e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions yarn-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@ To add a new package, make sure to add it to the `build_manifest.json`, to the `
- `tsconfig.json`

You may also need to modify the [Dockerfile](yarn-project/yarn-project-base/Dockerfile) to copy your new `package.json` into the container to get CI to pass.

## Deploying npm packages
`deploy-npm` script handles the releases of npm packages within yarn-project. But the initial release is a manual process:

1. Ensure relevant folders are copied in by docker in `yarn-project/yarn-project-base/Dockerfile` and `yarn-project/Dockerfile`
2. SSH into the CI
3. Run the following:
```sh
cd project
./build-system/scripts/setup_env "$(git rev-parse HEAD)" "" "" ""
source /tmp/.bash_env*
BUILD_SYSTEM_DEBUG=1
COMMIT_TAG=<RELEASE_TAG_NUMBER_YOU_WANT e.g. aztec-packages-v0.8.8>
```
4. Follow the [`deploy-npm` script](./deploy_npm.sh).
- Best to run the `deploy_package()` method line by line by manually setting `REPOSITORY` var.
- Extract `VERSION` as the script shows (in the eg it should be 0.8.8)
- Skip the version existing checks like `if [ "$VERSION" == "$PUBLISHED_VERSION" ]` and `if [ "$VERSION" != "$HIGHER_VERSION" ]`. Since this is our first time deploying the package, `PUBLISHED_VERSION` and `HIGHER_VERSION` will be empty and hence these checks would fail. These checks are necessary in the CI for continual releases.
- Locally update the package version in package.json using `jq` as shown in the script
- Do a dry-run
- If dry run succeeds, publish the package!
5. Create a PR by adding your package into the `deploy-npm` script so next release onwards, CI can cut releases for your package.

0 comments on commit df15d1e

Please sign in to comment.