"publication_script": "if [[ \"${PREVIEW_MODE:-false}\" == \"true\" ]]; then\n echo \"External previews do not create GitHub releases.\"\n exit 0\nfi\nset -euo pipefail\nCHANGELOG_MD=$(python3 ../../.github/scripts/desktop-changelog.py latest-release --format markdown || echo \"- Bug fixes and improvements\")\n\n# Build changelog as pipe-separated string for KEY_VALUE_START\nCHANGELOG_PIPE=$(echo \"$CHANGELOG_MD\" | sed 's/^- //' | tr '\\n' '|' | sed 's/|$//')\n\nRELEASE_NOTES=\"## OMI Desktop v${VERSION}\n\n### What's New\n${CHANGELOG_MD}\n\n### Downloads\n- **DMG Installer**: For fresh installs, download the DMG below\n- **Auto-Update**: Existing users will receive this update automatically via Sparkle\n\n<!-- KEY_VALUE_START\nisLive: false\nchannel: candidate\nedSignature: ${ED_SIGNATURE}\nchangelog: ${CHANGELOG_PIPE}\nKEY_VALUE_END -->\"\n\n# A candidate is the evidence container. Once published, preserve its\n# signed artifacts and every qualification observation; retries only\n# resume the dispatch handoff below.\nif gh release view \"$CM_TAG\" --repo \"$GITHUB_REPO\" >/dev/null 2>&1; then\n echo \"GitHub release candidate already exists; preserving immutable evidence for $CM_TAG\"\nelse\n # The backend reservation is the authoritative Beta fence. It runs\n # only after package, signature, notarization, and signed smoke pass,\n # immediately before this workflow creates the immutable candidate.\n set -euo pipefail\n test -n \"${BETA_PROMOTION_TOKEN:-}\" || {\n echo \"ERROR: BETA_PROMOTION_TOKEN is required to reserve a canonical candidate\" >&2\n exit 1\n }\n curl --fail-with-body --silent --show-error \\\n --request POST \"${OMI_PYTHON_API_URL%/}/v2/desktop/beta/candidates/reserve\" \\\n --header \"Authorization: Bearer ${BETA_PROMOTION_TOKEN}\" \\\n --header 'Content-Type: application/json' \\\n --data \"{\\\"tag\\\":\\\"${CM_TAG}\\\"}\"\n gh release create \"$CM_TAG\" \\\n --repo \"$GITHUB_REPO\" \\\n --title \"Omi Desktop v${VERSION} (candidate)\" \\\n --notes \"$RELEASE_NOTES\" \\\n \"$SPARKLE_ZIP_PATH\" \\\n \"$DMG_PATH\" \\\n \"$BUILD_DIR/desktop-smoke-result.json\"\n echo \"GitHub release candidate created: $CM_TAG\"\nfi\n",
0 commit comments