diff --git a/README.md b/README.md index 14fc089b4b..2b56ecabdd 100644 --- a/README.md +++ b/README.md @@ -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-.0`)> and `yarn publish:release` for the proper semver release. - If you aren't using [Frame](https://frame.sh/), prepend `CANNON_REGISTRY_PROVIDER_URL= CANNON_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. diff --git a/markets/perps-market/cannonfile.test.toml b/markets/perps-market/cannonfile.test.toml index f080434a42..1c6735d440 100644 --- a/markets/perps-market/cannonfile.test.toml +++ b/markets/perps-market/cannonfile.test.toml @@ -1,5 +1,5 @@ -name = "synthetix-perps-market" -version = "<%= package.version %>-testable" +name = "synthetix-perps-market-testable" +version = "<%= package.version %>" description = "Perps market implementation" [setting.coreProxyOwner] @@ -11,10 +11,10 @@ description = "perps market owner" defaultValue = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" [setting.synthetixPackage] -defaultValue = "synthetix:<%= package.version %>-testable" +defaultValue = "synthetix-testable:<%= package.version %>" [setting.spotMarketPackage] -defaultValue = "synthetix-spot-market:<%= package.version %>-testable" +defaultValue = "synthetix-spot-market-testable:<%= package.version %>" [import.synthetix] source = "<%= settings.synthetixPackage %>" diff --git a/markets/perps-market/package.json b/markets/perps-market/package.json index 2e84ca33d1..2ab3b6abe3 100644 --- a/markets/perps-market/package.json +++ b/markets/perps-market/package.json @@ -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-testable:$(node -p 'require(`./package.json`).version') --quiet", "size-contracts": "hardhat compile && hardhat size-contracts", - "postpack": "yarn publish-contracts", + "postpack": "yarn publish-contracts && yarn publish-testable", "docgen": "hardhat docgen" }, "keywords": [], diff --git a/markets/spot-market/cannonfile.test.toml b/markets/spot-market/cannonfile.test.toml index 67b86efc71..3616bbc6fd 100644 --- a/markets/spot-market/cannonfile.test.toml +++ b/markets/spot-market/cannonfile.test.toml @@ -1,5 +1,5 @@ -name = "synthetix-spot-market" -version = "<%= package.version %>-testable" +name = "synthetix-spot-market-testable" +version = "<%= package.version %>" description = "Spot market implementation" [setting.coreProxyOwner] @@ -11,7 +11,7 @@ description = "spot market owner" defaultValue = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" [setting.synthetixPackage] -defaultValue = "synthetix:<%= package.version %>-testable" +defaultValue = "synthetix-testable:<%= package.version %>" [import.synthetix] source = "<%= settings.synthetixPackage %>" diff --git a/markets/spot-market/package.json b/markets/spot-market/package.json index 38472cdae0..993aeae95d 100644 --- a/markets/spot-market/package.json +++ b/markets/spot-market/package.json @@ -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-testable:$(node -p 'require(`./package.json`).version') --quiet", "size-contracts": "hardhat compile && hardhat size-contracts", - "postpack": "yarn publish-contracts", + "postpack": "yarn publish-contracts && yarn publish-testable", "docgen": "hardhat docgen" }, "keywords": [], diff --git a/package.json b/package.json index f2f9d1b83b..826a277e7b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/protocol/oracle-manager/cannonfile.test.toml b/protocol/oracle-manager/cannonfile.test.toml index f01e530791..0d7f76b337 100644 --- a/protocol/oracle-manager/cannonfile.test.toml +++ b/protocol/oracle-manager/cannonfile.test.toml @@ -1,4 +1,5 @@ -version = "<%= package.version %>-testable" +name = "oracle-manager-testable" +version = "<%= package.version %>" include = [ "cannonfile.toml" diff --git a/protocol/oracle-manager/package.json b/protocol/oracle-manager/package.json index 0c8b60a86b..95f276aaf2 100644 --- a/protocol/oracle-manager/package.json +++ b/protocol/oracle-manager/package.json @@ -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-testable:$(node -p 'require(`./package.json`).version') --quiet", "postpack": "yarn publish-contracts", "docgen": "hardhat docgen" }, diff --git a/protocol/synthetix/cannonfile.test.toml b/protocol/synthetix/cannonfile.test.toml index d642dbfcd0..44123fd9f0 100644 --- a/protocol/synthetix/cannonfile.test.toml +++ b/protocol/synthetix/cannonfile.test.toml @@ -1,6 +1,7 @@ # overrides to create a testable deployment of the core system -version = "<%= package.version %>-testable" +name = "synthetix-testable" +version = "<%= package.version %>" include = [ "cannonfile.toml" @@ -166,4 +167,4 @@ args = [[ "0x7d632bd2<%= defaultAbiCoder.encode(['bytes32', 'bool'], [formatBytes32String('createPool'), true]).slice(2) %>", ]] -depends = ["invoke.upgrade_core_proxy"] \ No newline at end of file +depends = ["invoke.upgrade_core_proxy"] diff --git a/protocol/synthetix/package.json b/protocol/synthetix/package.json index 3f7c3be09a..0dbbe78f93 100644 --- a/protocol/synthetix/package.json +++ b/protocol/synthetix/package.json @@ -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-testable:$(node -p 'require(`./package.json`).version') --quiet", + "postpack": "yarn publish-contracts && yarn publish-testable", "docgen": "hardhat docgen" }, "keywords": [],