Skip to content
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

feat: deploy l1 contracts npm pkg #2754

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add instructions
rahul-kothari committed Oct 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit df15d1e7477702a1e6e41eba0f5f63c01052efd9
22 changes: 22 additions & 0 deletions yarn-project/README.md
Original file line number Diff line number Diff line change
@@ -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.