Skip to content

Commit

Permalink
fix(ci): publish pkg if no releases yet
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Nov 25, 2024
1 parent bada8b8 commit 9ac3f5c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ async function maybePushToSoldeer() {
const response = await fetch(
"https://api.soldeer.xyz/api/v1/revision?project_name=semaphore-protocol-contracts&limit=1"
)
const { data, status } = await response.json()
const { data } = await response.json()

// fail status if no version published at all yet
if (status === "fail" || compare(contractsLocalVersion, data[0].version) === 1)
if (
data.length === 0 || // data = [] if no version has ever been published yet
compare(contractsLocalVersion, data[0].version) === 1
)
execSync(`soldeer push semaphore-protocol-contracts~${contractsLocalVersion} packages/contracts/contracts`, {
stdio: "inherit"
})
Expand Down

0 comments on commit 9ac3f5c

Please sign in to comment.