-
Notifications
You must be signed in to change notification settings - Fork 230
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
chore: publish contracts to soldeer #820
Conversation
chore: publish contracts to soldeer
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
package.json
Outdated
@@ -21,8 +21,8 @@ | |||
"format": "prettier -c . && yarn workspace semaphore-docs format", | |||
"format:write": "prettier -w . && yarn workspace semaphore-docs format:write", | |||
"docs": "typedoc", | |||
"version:bump": "yarn workspaces foreach -A --no-private version -d ${0} && yarn version apply --all && yarn remove:stable-version-field && NO_HOOK=1 git commit -am \"chore: v${0}\" && git tag v${0}", | |||
"version:publish": "yarn build:libraries && yarn clean:cli-templates && yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public", | |||
"version:bump": "ts-node scripts/version.ts ${0}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no directly related to this PR, but given the length of this command, I suggest extracting it in its own script definition file to improve readability
package.json
Outdated
"version:bump": "yarn workspaces foreach -A --no-private version -d ${0} && yarn version apply --all && yarn remove:stable-version-field && NO_HOOK=1 git commit -am \"chore: v${0}\" && git tag v${0}", | ||
"version:publish": "yarn build:libraries && yarn clean:cli-templates && yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public", | ||
"version:bump": "ts-node scripts/version.ts ${0}", | ||
"version:publish": "ts-node scripts/publish.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one we need to change to add the soldeer stuff.
As it gets more complicated, better to make a dedicated script file here too
async function maybePushToSoldeer() { | ||
// api not documented, may change, found by inspecting the network tab | ||
const response = await fetch( | ||
"https://api.soldeer.xyz/api/v1/revision?project_name=semaphore-protocol-contracts&limit=1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest semaphore-protocol-contracts
as pkg name on soldeer. soldeer does not support orgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about semaphore-contracts
? Sounds easier to remember
const { data, status } = await response.json() | ||
|
||
// fail status is no version published at all yet | ||
if (status === "fail" || compare(contractsLocalVersion, data[0].version) === 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status will be fail only for the first run (no pkg in soldeer db yet)
scripts/publish.ts
Outdated
"soldeer", | ||
["push", `semaphore-protocol-contracts~${contractsLocalVersion}`, "packages/contracts/contracts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #800
Publish semaphore contracts to https://soldeer.xyz as
semaphore-protocol-contracts
in addition to publishing to npm as@semaphore-protocol/contracts
.