Skip to content

Commit

Permalink
fix(ci): publish pkg if no releases yet (#900)
Browse files Browse the repository at this point in the history
* fix(ci): publish pkg if no releases yet

* chore(ci): add workflow release trigger

* fix: workflow dispatch instead of workflow release
  • Loading branch information
sripwoud authored Nov 26, 2024
1 parent ebd9a27 commit 91f8a4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ permissions:
contents: write

on:
workflow_dispatch:
push:
tags:
- "v*"
Expand Down
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 91f8a4b

Please sign in to comment.