Skip to content

Commit 1a902b2

Browse files
committed
ci: skip winget publish on beta and ensure finalize always runs
Beta releases no longer trigger unnecessary Winget submissions, and release finalization now completes even when some build artifacts are missing.
1 parent bbe4a04 commit 1a902b2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ jobs:
213213
needs:
214214
- build-cli
215215
- version
216+
if: github.ref_name != 'beta'
216217
continue-on-error: false
217218
env:
218219
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
@@ -547,6 +548,7 @@ jobs:
547548
- sign-cli-windows
548549
- build-tauri
549550
- build-electron
551+
if: always() && !failure() && !cancelled()
550552
runs-on: blacksmith-4vcpu-ubuntu-2404
551553
steps:
552554
- uses: actions/checkout@v3

packages/desktop/scripts/finalize-latest-json.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const releaseId = process.env.OPENCODE_RELEASE
2121
if (!releaseId) throw new Error("OPENCODE_RELEASE is required")
2222

2323
const version = process.env.OPENCODE_VERSION
24-
if (!releaseId) throw new Error("OPENCODE_VERSION is required")
24+
if (!version) throw new Error("OPENCODE_VERSION is required")
2525

2626
const token = process.env.GH_TOKEN ?? process.env.GITHUB_TOKEN
2727
if (!token) throw new Error("GH_TOKEN or GITHUB_TOKEN is required")
@@ -54,7 +54,10 @@ const assets = release.assets ?? []
5454
const assetByName = new Map(assets.map((asset) => [asset.name, asset]))
5555

5656
const latestAsset = assetByName.get("latest.json")
57-
if (!latestAsset) throw new Error("latest.json asset not found")
57+
if (!latestAsset) {
58+
console.log("latest.json not found, skipping tauri finalization")
59+
process.exit(0)
60+
}
5861

5962
const latestRes = await fetch(latestAsset.url, {
6063
headers: {

0 commit comments

Comments
 (0)