Skip to content

Commit

Permalink
Add publish testable scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Aug 15, 2023
1 parent 5e6e736 commit d0ce1ce
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ To prepare for system upgrades, this repository is used to release new versions

- Ensure you have the latest version of [Cannon](https://usecannon.com) installed: `@usecannon/cli` and `hardhat-cannon` are upgraded to the latest through the repository (use `yarn upgrade-interactive` command).
- After installing for the first time, run `yarn cannon:setup` to configure IPFS and a reliable RPC endpoint to communicate with the Cannon package registry.
- Unless `npm whoami` returns an npm account with publishing permissions for the `@synthetixio` organization, confirm an `@synthetixio` npm publishing key is set as `$NPM_TOKEN` in the `.env` file.
- Unless `npm whoami` returns an npm account with publishing permissions for the `@synthetixio` organization, confirm a `@synthetixio` npm publishing key is set as `$NPM_TOKEN` in the `.env` file.
- Confirm you are on the `main` branch and there are no git changes `git diff --exit-code .`
- Publish the release with `yarn publish:dev` for the pre-release (no git tag, version looks like `1.2.3-<GIT_SHA>.0`)> and `yarn publish:release` for the proper semver release.
- If you aren't using [Frame](https://frame.sh/), prepend `CANNON_REGISTRY_PROVIDER_URL=<MAINNET_RPC> CANNON_PRIVATE_KEY=<PRIVATE_KEY>` to the commands above.
- In case Cannon publish fails you can run `yarn publish-contracts` in the root to retry publishing all Cannon packages. Or run `yarn publish-contracts` in each failed package separately.
- In all of the package.json files, revert dependencies' version changes back to "workspaces:*"` (leaving the change to `gitHead`, if applicable), commit, and push.
- In case Cannon publish fails you can run `yarn publish-contracts` (and/or `yarn publish-testable`) in the root to retry publishing all Cannon packages. Or run `yarn publish-contracts` (and/or `yarn publish-testable`) in each failed package separately.
- In all package.json files, revert dependencies' version changes back to "workspaces:*"` (leaving the change to `gitHead`, if applicable), commit, and push.
3 changes: 2 additions & 1 deletion markets/perps-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"coverage1": "hardhat coverage --network hardhat",
"compile-contracts": "hardhat compile",
"publish-contracts": "yarn build && cannon publish synthetix-perps-market:$(node -p 'require(`./package.json`).version') --quiet",
"publish-testable": "yarn build-testable && cannon publish synthetix-perps-market:$(node -p 'require(`./package.json`).version')-testable --quiet",
"size-contracts": "hardhat compile && hardhat size-contracts",
"postpack": "yarn publish-contracts",
"postpack": "yarn publish-contracts && yarn publish-testable",
"docgen": "hardhat docgen"
},
"keywords": [],
Expand Down
3 changes: 2 additions & 1 deletion markets/spot-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"coverage1": "hardhat coverage --network hardhat",
"compile-contracts": "hardhat compile",
"publish-contracts": "yarn build && cannon publish synthetix-spot-market:$(node -p 'require(`./package.json`).version') --quiet",
"publish-testable": "yarn build-testable && cannon publish synthetix-spot-market:$(node -p 'require(`./package.json`).version')-testable --quiet",
"size-contracts": "hardhat compile && hardhat size-contracts",
"postpack": "yarn publish-contracts",
"postpack": "yarn publish-contracts && yarn publish-testable",
"docgen": "hardhat docgen"
},
"keywords": [],
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"scripts": {
"clean": "yarn workspaces foreach --parallel --verbose run clean",
"build-prerelease-dev": "git diff --exit-code && yarn lerna exec -- npm version prepatch --no-git-tag-version --no-workspaces-update && yarn && yarn build && git stash && yarn",
"build-testable": "yarn workspaces foreach --topological-dev --verbose run build-testable",
"build": "yarn workspaces foreach --topological-dev --verbose run build",
"test": "yarn workspaces foreach --parallel --verbose run test",
"coverage": "yarn workspaces foreach --verbose run coverage",
Expand All @@ -36,6 +37,7 @@
"publish:release": "lerna publish --force-publish",
"publish:dev": "lerna publish --force-publish --canary --dist-tag dev --preid dev.$(git rev-parse --short HEAD)",
"publish-contracts": "yarn workspaces foreach --verbose run publish-contracts",
"publish-testable": "yarn workspaces foreach --topological-dev --verbose run publish-testable",
"prepublishOnly": "node ./prepublishOnly.js",
"docgen": "yarn workspaces foreach --verbose run docgen && yarn docgen:contracts",
"docgen:contracts": "yarn workspace @synthetixio/docgen docgen:contracts",
Expand Down
1 change: 1 addition & 0 deletions protocol/oracle-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"compile-contracts": "hardhat compile",
"size-contracts": "hardhat compile && hardhat size-contracts",
"publish-contracts": "yarn build && cannon publish oracle-manager:$(node -p 'require(`./package.json`).version') --quiet",
"publish-testable": "yarn build-testable && cannon publish oracle-manager:$(node -p 'require(`./package.json`).version')-testable --quiet",
"postpack": "yarn publish-contracts",
"docgen": "hardhat docgen"
},
Expand Down
3 changes: 2 additions & 1 deletion protocol/synthetix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"compile-contracts": "hardhat compile",
"size-contracts": "hardhat compile && hardhat size-contracts",
"publish-contracts": "yarn build && cannon publish synthetix:$(node -p 'require(`./package.json`).version') --quiet",
"postpack": "yarn publish-contracts",
"publish-testable": "yarn build-testable && cannon publish synthetix:$(node -p 'require(`./package.json`).version')-testable --quiet",
"postpack": "yarn publish-contracts && yarn publish-testable",
"docgen": "hardhat docgen"
},
"keywords": [],
Expand Down

0 comments on commit d0ce1ce

Please sign in to comment.