Skip to content

Commit

Permalink
feat(release): release scripts & docs (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlescano authored Feb 29, 2024
1 parent 1e3d32d commit 069b9d7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 226 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,31 @@ cd ./packages/website && npm run dev
See [CONTRIBUTING.md](./CONTRIBUTING.md)

### Version and Publish
We use [changesets](https://github.com/changesets/changesets) to manage versions on our monorepo.

We bump and publish manually using lerna's [version and publish](https://lerna.js.org/docs/features/version-and-publish) workflow.

#### Stable Release

1. To create a `stable` release, just run `npm run publish` and select the version you want to be deployed.
2. Run `npm run update-stables` to make sure that all the other private packages reference to new release.

#### Alpha Release

For creating an `alpha` release, use `npm run publish --canary`, which will deploy a version with the format `x.x.x-alpha.<gitref>`.

#### Changesets

We can also use [changesets](https://github.com/changesets/changesets) to manage versions on our monorepo.

Currently our [release workflow](.github/workflows/release.yml) on our CI handles bumping package versions and publishing releases to npm through lerna.
It only publishes releases if any changeset PR's have been added to the commit history merged into main.

To trigger a new version bump run the following command (from the root of the repo):
```

```
npm run changeset
```

If a situation where a commit was merged without a changeset, we can always bump and publish manually using lerna's [version and publish](https://lerna.js.org/docs/features/version-and-publish) workflow:

`npx lerna publish --no-private` will bump package versions and find npm packages that need to be published in the repo.

## License

[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
Expand Down
220 changes: 7 additions & 213 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint:fix:sol": "prettier --write '{packages,examples}/*/{contracts,src}/**/*.sol'",
"lint:fix": "npm-run-parallel lint:fix:js lint:fix:sol",
"build": "lerna run build --ignore cannon-website --ignore indexer",
"publish": "lerna publish",
"publish": "lerna publish --no-private",
"update-stables": "npm i @usecannon/builder@latest @usecannon/cli@latest -w indexer -w cannon-registry -w cannon-website && npm i hardhat-cannon@latest -w cannon-registry",
"test": "npm run test --workspaces --if-present",
"docgen-md": "cd ./packages/builder && npm run docgen && cd - && cd ./packages/cli && npm run docgen",
"website-dev": "npm run dev --workspace=packages/website",
Expand Down
3 changes: 2 additions & 1 deletion packages/indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@usecannon/builder": "2.11.9",
"@usecannon/builder": "^2.11.9",
"@usecannon/cli": "^2.11.17",
"lodash": "^4.17.21",
"redis": "^4.6.13",
"viem": "^2.7.10"
Expand Down
6 changes: 3 additions & 3 deletions packages/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"@typechain/hardhat": "6.1.2",
"@types/mocha": "9.1.1",
"@types/node": "18.0.0",
"@usecannon/builder": "2.11.9",
"@usecannon/cli": "2.11.9",
"@usecannon/builder": "^2.11.9",
"@usecannon/cli": "^2.11.9",
"chai": "4.3.6",
"dotenv": "16.0.1",
"ethers": "5.7.1",
"hardhat": "^2.12.6",
"hardhat-cannon": "2.11.9",
"hardhat-cannon": "^2.11.9",
"hardhat-contract-sizer": "^2.7.0",
"hardhat-gas-reporter": "^1.0.9",
"mocha": "10.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@types/node": "20.3.2",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.6",
"@usecannon/builder": "2.11.9",
"@usecannon/cli": "2.11.9",
"@usecannon/builder": "^2.11.17",
"@usecannon/cli": "^2.11.17",
"@vercel/analytics": "^1.1.1",
"axios": "^1.6.2",
"browser-level": "^1.0.1",
Expand Down

0 comments on commit 069b9d7

Please sign in to comment.