ci(desktop): split release pipeline per-OS; gate MSIX work on windows only
The msixbundle + finalize jobs were both gated on the entire 6-leg build matrix, so macos + linux legs blocked the win32 App Installer feed and everything else downstream. Restructure desktop-bundled-release.yml into per-OS jobs: - build-win32 (x64 + arm64) — the only active builder legs; builds the bundled + Store variants, audits arch, uploads *.msix, stages to R2. - build-darwin / build-linux — dummy skips for now (no macOS updater arm; linux unshipped). Matrix kept so downstream jobs stay green; re-enable by restoring the build body + runners. - publish-win32-updater (was msixbundle) — needs build-win32 only; stages the App Installer feed (.appinstaller + universal .msixbundle). - publish-win32-store (NEW, parallel) — bundles the two Store-*.msix into one universal Store .msixbundle and submits it to the Windows Store via the MSStore CLI (microsoft/microsoft-store-apppublisher@v1.4). Stable tags only; gated on MS_STORE_PRODUCT_ID var so it stays skipped until the release-signing environment is configured. The store bundle is left unsigned on purpose — Partner Center re-signs on ingestion. - publish-darwin-updater (was finalize) — dummy skip; no mac feed to publish until the darwin electron-updater arm returns. Shared plumbing: resolveWinSdkTools moves into msix-shared.mjs (single resolver for both bundle jobs, kills the dead candidates var); new bundle-store-msixbundle.mjs bundles the store per-arch packages and prints the bundle path on stdout for the workflow. Verified: node --check all scripts, yaml parses + needs graph resolves, 107 r2-release tests pass.
This commit is contained in:
368
.github/workflows/desktop-bundled-release.yml
vendored
368
.github/workflows/desktop-bundled-release.yml
vendored
@@ -2,20 +2,34 @@ name: Desktop Bundled Release
|
||||
|
||||
# Builds the bundled desktop installer for each (os, arch) target.
|
||||
#
|
||||
# tag admission (shape + pyproject lockstep + ancestry-on-origin/main,
|
||||
# resolved to an IMMUTABLE full SHA) → 6-target matrix → pm bundle
|
||||
# → stage artifacts to R2 (releases/tag/<tag>/) → finalize job merges
|
||||
# the darwin feeds (releases/darwin/<ch>/<channel>-mac.yml + dmg/zip),
|
||||
# the msixbundle job stages the win32 App Installer feeds
|
||||
# (releases/win32/<ch>/*.appinstaller + *.msixbundle) → builds table.
|
||||
# The GitHub release keeps the notes only — no binaries.
|
||||
# tag admission (shape + pyproject lockstep + ancestry on origin/main,
|
||||
# resolved to an IMMUTABLE full SHA) → per-OS builder jobs → stage
|
||||
# artifacts to R2 (releases/tag/<tag>/) → per-OS publish jobs write the
|
||||
# feeds → builds table.
|
||||
#
|
||||
# Per-OS topology (MSIX work is gated on the WINDOWS build only — mac/linux
|
||||
# legs never block the win32 feed or Store submission):
|
||||
#
|
||||
# build-win32 (win32-x64 + win32-arm64) → stage to R2 + upload *.msix
|
||||
# build-darwin / build-linux → DISABLED for now (dummy skips)
|
||||
# publish-win32-updater → App Installer feed
|
||||
# (needs build-win32): releases/win32/<stable|nightly>/*.appinstaller +
|
||||
# *.msixbundle (stage-msixbundle.mjs --variant bundled)
|
||||
# publish-win32-store → PARALLEL job (needs build-win32):
|
||||
# bundle the Store-*.msix into one universal Store .msixbundle and submit
|
||||
# it to the Windows Store via the MSStore CLI (stable tags only — the
|
||||
# Store never receives nightlies).
|
||||
# publish-darwin-updater → DISABLED (dummy skip — the
|
||||
# darwin electron-updater arm was removed; nothing publishes a mac feed)
|
||||
#
|
||||
# Feed layout (matches apps/desktop/electron/app-updater.ts's arms):
|
||||
# releases/win32/<stable|nightly>/<ch>.appinstaller App Installer feed
|
||||
# releases/win32/<stable|nightly>/*.msixbundle (msixbundle job)
|
||||
# releases/darwin/<stable|nightly>/*-mac.yml electron-updater (dmg/zip)
|
||||
# The finalize + msixbundle jobs write the feeds ONCE after the whole matrix
|
||||
# is green, so a failed leg can never publish a partial channel.
|
||||
# releases/win32/<stable|nightly>/*.msixbundle (publish-win32-updater)
|
||||
# releases/darwin/<stable|nightly>/*-mac.yml electron-updater feed (dmg/zip)
|
||||
# — feed layout preserved for when the darwin updater returns; the job is
|
||||
# currently a dummy skip.
|
||||
# The publish jobs write the feeds ONCE after the whole build-win32 matrix is
|
||||
# green, so a failed leg can never publish a partial channel.
|
||||
#
|
||||
# Payload staging is `hermes pm bundle` on the native runner. There is
|
||||
# no cross-target staging. Signing and notarization are a later commit;
|
||||
@@ -34,6 +48,17 @@ name: Desktop Bundled Release
|
||||
# release bucket; CLOUDFLARE_R2_BUCKET and CLOUDFLARE_R2_PUBLIC_URL are
|
||||
# non-secret vars. scripts/r2-release.mjs derives the S3 endpoint from
|
||||
# the account id and needs only node — no npm ci, no extra deps.
|
||||
#
|
||||
# Windows Store submission (publish-win32-store, stable tags only):
|
||||
# MSStore CLI via microsoft/microsoft-store-apppublisher. Credentials live
|
||||
# in the release-signing environment:
|
||||
# secrets: MS_STORE_TENANT_ID, MS_STORE_SELLER_ID, MS_STORE_CLIENT_ID,
|
||||
# MS_STORE_CLIENT_SECRET
|
||||
# vars: MS_STORE_PRODUCT_ID (the Partner Center product ID — gates
|
||||
# the job so it stays skipped until configured)
|
||||
# Flow: msstore reconfigure → msstore publish <Store-*.msixbundle> -id
|
||||
# The Store bundle is UNSIGNED on purpose — Partner Center re-signs on
|
||||
# ingestion (see sign-msix.mjs).
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -113,7 +138,10 @@ jobs:
|
||||
echo "tag $TAG resolves to $SHA (on origin/main)"
|
||||
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
# ── Windows builders (REAL) ───────────────────────────────────────────────
|
||||
# The only active builder legs. Every win32 downstream job (updater feed +
|
||||
# Store submission) is gated on THIS job, never on mac/linux.
|
||||
build-win32:
|
||||
name: bundled ${{ matrix.target.label }}
|
||||
needs: validate
|
||||
runs-on: ${{ matrix.target.runner }}
|
||||
@@ -123,14 +151,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- label: linux-x64
|
||||
runner: ubuntu-24.04
|
||||
- label: linux-arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
- label: darwin-arm64
|
||||
runner: macos-15
|
||||
- label: darwin-x64
|
||||
runner: macos-15-intel
|
||||
- label: win32-x64
|
||||
runner: windows-2025
|
||||
- label: win32-arm64
|
||||
@@ -147,16 +167,7 @@ jobs:
|
||||
CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}
|
||||
CLOUDFLARE_R2_PUBLIC_URL: ${{ vars.CLOUDFLARE_R2_PUBLIC_URL }}
|
||||
steps:
|
||||
- name: Disable Spotlight indexing and XProtect
|
||||
if: startsWith(matrix.target.label, 'darwin-')
|
||||
shell: bash
|
||||
run: |
|
||||
sudo mdutil -a -i off || true
|
||||
sudo pkill -9 XProtect >/dev/null || true
|
||||
while pgrep XProtect; do sleep 3; done
|
||||
|
||||
- name: Exclude build write paths from Defender scanning
|
||||
if: startsWith(matrix.target.label, 'win32-')
|
||||
shell: powershell
|
||||
run: |
|
||||
$paths = @(
|
||||
@@ -326,7 +337,7 @@ jobs:
|
||||
node-pty-prebuilds-${{ matrix.target.label }}-
|
||||
|
||||
- name: Azure login (OIDC)
|
||||
if: startsWith(matrix.target.label, 'win32-') && vars.AZURE_CLIENT_ID != ''
|
||||
if: vars.AZURE_CLIENT_ID != ''
|
||||
uses: azure/login@f5d393ae46f8fde4be8b75f32e3fc50e654ad0ca # v3.0.1
|
||||
with:
|
||||
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
||||
@@ -334,7 +345,7 @@ jobs:
|
||||
allow-no-subscriptions: true
|
||||
|
||||
- name: Mint federated token for the signing dlib
|
||||
if: startsWith(matrix.target.label, 'win32-') && vars.AZURE_CLIENT_ID != ''
|
||||
if: vars.AZURE_CLIENT_ID != ''
|
||||
shell: bash
|
||||
run: |
|
||||
file="$RUNNER_TEMP/azure-federated-token"
|
||||
@@ -347,19 +358,6 @@ jobs:
|
||||
( while sleep 240; do mint || true; done ) &
|
||||
echo "AZURE_FEDERATED_TOKEN_FILE=$file" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Write App Store Connect key for notarytool
|
||||
if: startsWith(matrix.target.label, 'darwin-')
|
||||
shell: bash
|
||||
env:
|
||||
APPLE_API_KEY_P8: ${{ secrets.APPLE_API_KEY_P8 }}
|
||||
run: |
|
||||
if [ -n "$APPLE_API_KEY_P8" ]; then
|
||||
printf '%s\n' "$APPLE_API_KEY_P8" > "$RUNNER_TEMP/apple-api-key.p8"
|
||||
echo "APPLE_API_KEY=$RUNNER_TEMP/apple-api-key.p8" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "APPLE_API_KEY_P8 secret not set — notarization will be skipped"
|
||||
fi
|
||||
|
||||
- name: Pin CMake < 4 for sdist builds
|
||||
# python-olm (matrix extra) builds libolm from sdist on non-Linux
|
||||
# targets, and its libolm/CMakeLists.txt requires CMake < 3.5
|
||||
@@ -368,7 +366,6 @@ jobs:
|
||||
# build configures. Linux uses the manylinux wheel — no build, no
|
||||
# cmake needed. The pip cmake package ships a binary wheel for
|
||||
# every non-Linux target (macos universal2, win_amd64, win_arm64).
|
||||
if: startsWith(matrix.target.label, 'darwin-') || startsWith(matrix.target.label, 'win32-')
|
||||
shell: bash
|
||||
run: |
|
||||
uv tool install cmake==3.31.6
|
||||
@@ -380,11 +377,6 @@ jobs:
|
||||
env:
|
||||
PYTHONUTF8: '1'
|
||||
CC_aarch64_pc_windows_msvc: ${{ matrix.target.label == 'win32-arm64' && 'clang' || '' }}
|
||||
DEBUG: 'electron-osx-sign*,electron-notarize*'
|
||||
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
|
||||
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
|
||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
AZURE_SIGN_ENDPOINT: ${{ vars.AZURE_SIGN_ENDPOINT }}
|
||||
AZURE_SIGN_ACCOUNT: ${{ vars.AZURE_SIGN_ACCOUNT }}
|
||||
AZURE_SIGN_PROFILE: ${{ vars.AZURE_SIGN_PROFILE }}
|
||||
@@ -393,27 +385,12 @@ jobs:
|
||||
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
|
||||
AZURE_TOKEN_CREDENTIALS: prod
|
||||
run: |
|
||||
if [ "$RUNNER_OS" = "macOS" ]; then
|
||||
ulimit -n 16384 2>/dev/null || true
|
||||
echo "file descriptor limit: soft=$(ulimit -Sn) hard=$(ulimit -Hn)"
|
||||
fi
|
||||
node scripts/build-bundled-desktop.mjs --tag="$HERMES_PAYLOAD_TAG" --variant=bundled
|
||||
# The Store-submission MSIX is the same bundled payload re-packed
|
||||
# with the Partner Center packaging identity (msixbundle job uploads
|
||||
# it to the tag archive; it never enters a feed dir).
|
||||
if [ "$RUNNER_OS" = "Windows" ]; then
|
||||
node scripts/build-bundled-desktop.mjs --tag="$HERMES_PAYLOAD_TAG" --variant=store
|
||||
fi
|
||||
|
||||
# Smoke the bundled payload on its native linux runner before it is
|
||||
# packed into the desktop artifact: the staged interpreter boots
|
||||
# hermes_cli out of the payload with no network and no PYTHONPATH.
|
||||
# This is the ONE linux build+smoke place — pm-bundle.yml no longer
|
||||
# stages or uploads a duplicate linux payload.
|
||||
- name: Smoke test the payload
|
||||
if: startsWith(matrix.target.label, 'linux-')
|
||||
shell: bash
|
||||
run: bash scripts/smoke-payload.sh apps/desktop/build/agent-payload
|
||||
# with the Partner Center packaging identity (publish-win32-store
|
||||
# bundles these into the universal Store .msixbundle and submits it;
|
||||
# they also land in the tag archive, never a feed dir).
|
||||
node scripts/build-bundled-desktop.mjs --tag="$HERMES_PAYLOAD_TAG" --variant=store
|
||||
|
||||
- name: Audit bundle architecture
|
||||
shell: bash
|
||||
@@ -425,32 +402,27 @@ jobs:
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
||||
with:
|
||||
# The mac feed ymls for finalize + (win32 legs) the actual .msix +
|
||||
# Store-.msix binaries for the msixbundle job to bundle and stage.
|
||||
# The mac/linux/AppImage binaries go straight to R2 from each leg.
|
||||
# The win32 legs' actual .msix + Store-.msix binaries: publish-win32-updater
|
||||
# bundles the per-arch .msix for the feed, publish-win32-store bundles the
|
||||
# Store-*.msix for the Windows Store submission.
|
||||
name: hermes-bundled-${{ matrix.target.label }}-${{ inputs.tag }}
|
||||
path: |
|
||||
apps/desktop/release/*-mac.yml
|
||||
apps/desktop/release/*.msix
|
||||
retention-days: 30
|
||||
if-no-files-found: warn
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Stage to Cloudflare R2
|
||||
if: inputs.upload_release == true
|
||||
shell: bash
|
||||
# Every artifact goes to releases/tag/<tag>/ (immutable staging).
|
||||
# The finalize job (below) merges these into the win32/darwin feed
|
||||
# dirs after the whole matrix is green — never from a leg, so a
|
||||
# failed leg cannot publish a partial feed.
|
||||
# The publish-win32-updater / publish-win32-store jobs merge these
|
||||
# into the feed / Store after the whole win32 matrix is green —
|
||||
# never from a leg, so a failed leg cannot publish a partial feed.
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
# Store-*.msix are archived by the dedicated loop below — exclude
|
||||
# them here so they are not uploaded twice.
|
||||
files=(apps/desktop/release/*.dmg apps/desktop/release/*.zip \
|
||||
apps/desktop/release/*.msix \
|
||||
apps/desktop/release/*.AppImage \
|
||||
apps/desktop/release/*.blockmap apps/desktop/release/latest*.yml \
|
||||
apps/desktop/release/nightly*.yml)
|
||||
files=(apps/desktop/release/*.msix)
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
echo "::error::no release artifacts found"; exit 1
|
||||
fi
|
||||
@@ -469,38 +441,48 @@ jobs:
|
||||
--tag "$HERMES_PAYLOAD_TAG" --key "$(basename "$f")" --file "$f"
|
||||
done
|
||||
|
||||
finalize:
|
||||
name: Publish feeds to R2
|
||||
needs: [validate, build]
|
||||
if: inputs.upload_release == true
|
||||
# ── macOS builders (DISABLED for now) ─────────────────────────────────────
|
||||
# No macOS updater arm exists today (the darwin electron-updater arm was
|
||||
# removed), so there is nothing to publish and no reason to burn mac
|
||||
# runner minutes. Re-enable by restoring the build body + runners here and
|
||||
# un-skipping publish-darwin-updater below.
|
||||
build-darwin:
|
||||
name: bundled darwin (disabled for now)
|
||||
needs: validate
|
||||
runs-on: ubuntu-24.04
|
||||
environment: release-signing
|
||||
timeout-minutes: 5
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- { label: darwin-arm64 } # runner: macos-15
|
||||
- { label: darwin-x64 } # runner: macos-15-intel
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
# Privileged job: pin to the SHA validate admitted, not the tag.
|
||||
ref: ${{ needs.validate.outputs.sha }}
|
||||
# Full checkout: r2-release.mjs imports ./msix-shared.mjs, so a
|
||||
# sparse checkout of scripts/r2-release.mjs alone would die with
|
||||
# ERR_MODULE_NOT_FOUND before the finalize run starts.
|
||||
- name: Download staged artifacts
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
pattern: hermes-bundled-*-${{ inputs.tag }}
|
||||
path: staged
|
||||
merge-multiple: true
|
||||
- name: Finalize feeds
|
||||
env:
|
||||
HERMES_PAYLOAD_TAG: ${{ inputs.tag }}
|
||||
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
|
||||
CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
|
||||
CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
|
||||
CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}
|
||||
run: node scripts/r2-release.mjs finalize --tag "$HERMES_PAYLOAD_TAG" --dir staged
|
||||
- name: Disabled
|
||||
shell: bash
|
||||
run: echo "::notice::darwin bundled builds are disabled for now — no macOS updater arm (wt/darwin-updater removed it); re-enable in desktop-bundled-release.yml"
|
||||
|
||||
msixbundle:
|
||||
name: Bundle the win32 MSIX feeds
|
||||
needs: [validate, build]
|
||||
# ── Linux builders (DISABLED for now) ─────────────────────────────────────
|
||||
build-linux:
|
||||
name: bundled linux (disabled for now)
|
||||
needs: validate
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- { label: linux-x64 } # runner: ubuntu-24.04
|
||||
- { label: linux-arm64 } # runner: ubuntu-24.04-arm
|
||||
steps:
|
||||
- name: Disabled
|
||||
shell: bash
|
||||
run: echo "::notice::linux bundled builds are disabled for now — re-enable in desktop-bundled-release.yml"
|
||||
|
||||
# ── Windows updater channels (REAL — gated on build-win32 only) ──────────
|
||||
publish-win32-updater:
|
||||
name: Publish the win32 App Installer feeds
|
||||
needs: [validate, build-win32]
|
||||
if: inputs.upload_release == true
|
||||
runs-on: windows-2025
|
||||
environment: release-signing
|
||||
@@ -554,7 +536,7 @@ jobs:
|
||||
|
||||
# makeappx + signtool live in the winCodeSign toolset that
|
||||
# electron-builder downloads into its cache during the build legs; the
|
||||
# msixbundle job runs on a fresh runner, so restore the same eb2 cache
|
||||
# publish jobs run on a fresh runner, so restore the same eb2 cache
|
||||
# the win32 legs saved. The path list MUST match the build legs'
|
||||
# byte-for-byte — actions/cache derives the version hash from the paths
|
||||
# input, so a shorter list computes a different version and the restore
|
||||
@@ -618,6 +600,156 @@ jobs:
|
||||
# .msix to the tag archive (never a feed dir).
|
||||
node scripts/stage-msixbundle.mjs --tag "$HERMES_PAYLOAD_TAG" --variant bundled
|
||||
|
||||
# ── Windows Store submission (REAL — PARALLEL with publish-win32-updater) ─
|
||||
# Bundles the two Store-*.msix into one universal Store .msixbundle and
|
||||
# submits it to the Windows Store. Stable tags only: the Store must never
|
||||
# receive a nightly (4-part monotonic version policy). Runs in PARALLEL
|
||||
# with the updater channel job — both gate on build-win32 only.
|
||||
publish-win32-store:
|
||||
name: Publish the Store submission to the Windows Store
|
||||
needs: [validate, build-win32]
|
||||
if: |
|
||||
inputs.upload_release == true
|
||||
&& !contains(inputs.tag, '-nightly.')
|
||||
&& vars.MS_STORE_PRODUCT_ID != ''
|
||||
runs-on: windows-2025
|
||||
environment: release-signing
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
HERMES_PAYLOAD_TAG: ${{ inputs.tag }}
|
||||
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
|
||||
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
|
||||
CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
|
||||
CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
|
||||
CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}
|
||||
CLOUDFLARE_R2_PUBLIC_URL: ${{ vars.CLOUDFLARE_R2_PUBLIC_URL }}
|
||||
MS_STORE_TENANT_ID: ${{ secrets.MS_STORE_TENANT_ID }}
|
||||
MS_STORE_SELLER_ID: ${{ secrets.MS_STORE_SELLER_ID }}
|
||||
MS_STORE_CLIENT_ID: ${{ secrets.MS_STORE_CLIENT_ID }}
|
||||
MS_STORE_CLIENT_SECRET: ${{ secrets.MS_STORE_CLIENT_SECRET }}
|
||||
MS_STORE_PRODUCT_ID: ${{ vars.MS_STORE_PRODUCT_ID }}
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
# Privileged job: pin to the SHA validate admitted, not the tag.
|
||||
ref: ${{ needs.validate.outputs.sha }}
|
||||
fetch-tags: true
|
||||
|
||||
- name: Resolve toolchain pins from pm/lock.json
|
||||
id: pins
|
||||
shell: bash
|
||||
run: |
|
||||
python -c '
|
||||
import json
|
||||
pkgs = json.load(open("pm/lock.json"))["packages"]
|
||||
for tool in ("node", "npm", "uv"):
|
||||
print(tool + "=" + pkgs[tool]["version"])
|
||||
' >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Resolve toolchain cache key
|
||||
id: toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
node -e '
|
||||
const l = require("./package-lock.json")
|
||||
const el = l.packages["apps/desktop/node_modules/electron"].version
|
||||
const eb = l.packages["node_modules/electron-builder"].version
|
||||
if (!el || !eb) process.exit(1)
|
||||
console.log(`electron=${el}`)
|
||||
console.log(`builder=${eb}`)
|
||||
' >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/setup-node@v7.0.0 # immutable release. safe to pin.
|
||||
with:
|
||||
node-version: ${{ steps.pins.outputs.node }}
|
||||
|
||||
# makeappx for the Store bundle lives in the same winCodeSign toolset
|
||||
# the win32 legs downloaded — restore the identical eb2 cache.
|
||||
- name: Resolve electron's default download cache path
|
||||
shell: bash
|
||||
run: |
|
||||
case "$RUNNER_OS" in
|
||||
Windows) echo "ELECTRON_DEFAULT_CACHE=$LOCALAPPDATA/electron/Cache" >> "$GITHUB_ENV" ;;
|
||||
macOS) echo "ELECTRON_DEFAULT_CACHE=$HOME/Library/Caches/electron" >> "$GITHUB_ENV" ;;
|
||||
*) echo "ELECTRON_DEFAULT_CACHE=$HOME/.cache/electron" >> "$GITHUB_ENV" ;;
|
||||
esac
|
||||
|
||||
- name: Cache electron + electron-builder toolchain
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/.cache/electron-builder
|
||||
${{ github.workspace }}/.cache/electron
|
||||
${{ env.ELECTRON_DEFAULT_CACHE }}
|
||||
key: eb2-${{ runner.os }}-${{ runner.arch }}-electron-${{ steps.toolchain.outputs.electron }}-builder-${{ steps.toolchain.outputs.builder }}
|
||||
restore-keys: |
|
||||
eb2-${{ runner.os }}-${{ runner.arch }}-
|
||||
|
||||
- name: Download win legs' MSIX (incl. Store-*.msix)
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
pattern: hermes-bundled-win32-*-${{ inputs.tag }}
|
||||
path: apps/desktop/release
|
||||
merge-multiple: true
|
||||
|
||||
- name: Bundle the Store submission MSIX
|
||||
id: storebundle
|
||||
shell: bash
|
||||
run: |
|
||||
# Prints the absolute bundle path on stdout (the machine-readable
|
||||
# result); logs go to stderr.
|
||||
bundle="$(node scripts/bundle-store-msixbundle.mjs --tag "$HERMES_PAYLOAD_TAG")"
|
||||
echo "bundle=$bundle" >> "$GITHUB_OUTPUT"
|
||||
echo "Store bundle: $bundle"
|
||||
|
||||
- name: Archive the Store bundle to the tag dir
|
||||
shell: bash
|
||||
run: |
|
||||
# The per-arch Store-*.msix are already in the immutable archive
|
||||
# (uploaded by the build legs); keep the assembled universal bundle
|
||||
# there too as the record of exactly what was submitted.
|
||||
node scripts/r2-release.mjs put \
|
||||
--tag "$HERMES_PAYLOAD_TAG" \
|
||||
--key "$(basename "${{ steps.storebundle.outputs.bundle }}")" \
|
||||
--file "${{ steps.storebundle.outputs.bundle }}"
|
||||
|
||||
- name: Setup MSStore CLI
|
||||
uses: microsoft/microsoft-store-apppublisher@cc9910a8d59f2eb55cbb83df0a3800cf3b5300e0 # v1.4
|
||||
|
||||
- name: Configure Store credentials
|
||||
shell: bash
|
||||
run: |
|
||||
msstore reconfigure \
|
||||
--tenantId "$MS_STORE_TENANT_ID" \
|
||||
--sellerId "$MS_STORE_SELLER_ID" \
|
||||
--clientId "$MS_STORE_CLIENT_ID" \
|
||||
--clientSecret "$MS_STORE_CLIENT_SECRET"
|
||||
|
||||
- name: Publish the Store submission
|
||||
shell: bash
|
||||
run: |
|
||||
# The universal Store .msixbundle is accepted directly by msstore
|
||||
# publish (PackageFilesExtensionInclude: .msix/.msixbundle/.msixupload).
|
||||
# Partner Center signs on ingestion — no signing here.
|
||||
msstore publish "${{ steps.storebundle.outputs.bundle }}" -id "$MS_STORE_PRODUCT_ID"
|
||||
|
||||
# ── macOS updater channel (DISABLED — dummy skip) ─────────────────────────
|
||||
# No macOS updater arm exists (darwin electron-updater was removed in
|
||||
# wt/darwin-updater), so there is no mac feed to publish. Kept as a dummy
|
||||
# success so the dependency graph (builds-table, publish-nightly) stays
|
||||
# green. Re-enable with the darwin arm: restore r2-release.mjs finalize
|
||||
# (merged *-mac.yml → releases/darwin/<channel>/<channel>-mac.yml).
|
||||
publish-darwin-updater:
|
||||
name: Publish the macOS updater feed (disabled for now)
|
||||
needs: [validate, build-darwin]
|
||||
if: inputs.upload_release == true
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Disabled
|
||||
shell: bash
|
||||
run: echo "::notice::macOS updater feed publish is disabled for now — no macOS updater arm; re-enable with r2-release.mjs finalize when the darwin updater returns"
|
||||
|
||||
builds-pending:
|
||||
name: Mark the builds table as in progress
|
||||
if: inputs.upload_release == true
|
||||
@@ -640,7 +772,7 @@ jobs:
|
||||
|
||||
builds-table:
|
||||
name: Render the release builds table
|
||||
needs: [validate, build, msixbundle, finalize]
|
||||
needs: [validate, build-win32, build-darwin, build-linux, publish-win32-updater, publish-darwin-updater]
|
||||
if: inputs.upload_release == true
|
||||
runs-on: ubuntu-24.04
|
||||
environment: release-signing
|
||||
@@ -669,15 +801,17 @@ jobs:
|
||||
|
||||
publish-nightly:
|
||||
name: Publish the nightly release
|
||||
needs: [build, builds-table, msixbundle, finalize]
|
||||
needs: [build-win32, build-darwin, build-linux, builds-table, publish-win32-updater, publish-darwin-updater]
|
||||
if: |
|
||||
always()
|
||||
&& inputs.upload_release == true
|
||||
&& contains(inputs.tag, '-nightly.')
|
||||
&& needs.build.result == 'success'
|
||||
&& needs.build-win32.result == 'success'
|
||||
&& needs.build-darwin.result == 'success'
|
||||
&& needs.build-linux.result == 'success'
|
||||
&& needs.builds-table.result == 'success'
|
||||
&& needs.msixbundle.result == 'success'
|
||||
&& needs.finalize.result == 'success'
|
||||
&& needs.publish-win32-updater.result == 'success'
|
||||
&& needs.publish-darwin-updater.result == 'success'
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Publish
|
||||
|
||||
84
scripts/bundle-store-msixbundle.mjs
Normal file
84
scripts/bundle-store-msixbundle.mjs
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env node
|
||||
// bundle-store-msixbundle.mjs — the Store-submission bundle step of the
|
||||
// desktop-bundled-release workflow's store-publish job.
|
||||
//
|
||||
// The win32 build legs produce per-arch Store-submission packages
|
||||
// (Store-<name>-<fileVersion>-win-<arch>.msix, built with
|
||||
// HERMES_DESKTOP_VARIANT=store / the Partner Center identity). This script
|
||||
// bundles the x64 + arm64 packages into ONE universal Store .msixbundle for
|
||||
// the Windows Store submission, and prints the bundle's absolute path on
|
||||
// stdout (the workflow captures it for `msstore publish`).
|
||||
//
|
||||
// The bundle is deliberately left UNSIGNED: the Store re-signs the package
|
||||
// with the Microsoft Store certificate on ingestion (same posture as the
|
||||
// build legs, whose Store-*.msix ship unsigned — see sign-msix.mjs).
|
||||
//
|
||||
// Usage (win runner, bash):
|
||||
// node scripts/bundle-store-msixbundle.mjs --tag vX.Y.Z
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import { appIdentity, resolveWinSdkTools } from './msix-shared.mjs'
|
||||
|
||||
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
|
||||
// node strips the first '--' (and an immediately-following option) for its
|
||||
// own use; parse space-separated flag pairs, not --flag=value.
|
||||
const args = process.argv.slice(2)
|
||||
const flagValue = (name) => {
|
||||
for (let i = 0; i < args.length - 1; i += 1) {
|
||||
if (args[i] === name) return args[i + 1]
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
const tag = flagValue('--tag') || process.env.HERMES_PAYLOAD_TAG
|
||||
if (!tag) {
|
||||
console.error('[bundle-store] --tag=<vX.Y.Z> is required')
|
||||
process.exit(1)
|
||||
}
|
||||
if (process.platform !== 'win32') {
|
||||
console.error('[bundle-store] this job must run on a Windows runner (makeappx)')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// product-identity.cjs keys the app name off HERMES_DESKTOP_VARIANT — the
|
||||
// Store-submission artifacts carry the Store- prefix + Partner Center
|
||||
// identity, so the env var MUST be 'store' before the identity lookup.
|
||||
process.env.HERMES_DESKTOP_VARIANT = 'store'
|
||||
|
||||
const desktop = path.join(REPO_ROOT, 'apps', 'desktop')
|
||||
const releaseDir = path.join(desktop, 'release')
|
||||
const { name, version, fileVersion } = appIdentity(desktop, tag)
|
||||
|
||||
// Per-arch Store-submission packages: electron-builder names them with the
|
||||
// Store- prefix + appInfo.version (the 3-part or full-nightly string), which
|
||||
// appIdentity reports as `fileVersion` — same convention as the out-of-store
|
||||
// bundle in stage-msixbundle.mjs.
|
||||
const storeMsix = (arch) => path.join(releaseDir, `Store-${name}-${fileVersion}-win-${arch}.msix`)
|
||||
const x64 = storeMsix('x64')
|
||||
const arm64 = storeMsix('arm64')
|
||||
if (!fs.existsSync(x64) || !fs.existsSync(arm64)) {
|
||||
console.error(`[bundle-store] need both per-arch Store-*.msix to bundle:\n ${x64}\n ${arm64}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// makeappx bundle /d includes EVERY .msix in the dir — stage only the two
|
||||
// Store packages into a clean dir (mirror stage-msixbundle.mjs).
|
||||
const staging = path.join(releaseDir, '__store-bundle-staging')
|
||||
fs.rmSync(staging, { recursive: true, force: true })
|
||||
fs.mkdirSync(staging, { recursive: true })
|
||||
fs.copyFileSync(x64, path.join(staging, path.basename(x64)))
|
||||
fs.copyFileSync(arm64, path.join(staging, path.basename(arm64)))
|
||||
|
||||
const bundle = path.join(releaseDir, `Store-${name}-${version}-win.msixbundle`)
|
||||
const makeappx = path.join(resolveWinSdkTools(), 'makeappx.exe')
|
||||
if (fs.existsSync(bundle)) fs.rmSync(bundle, { force: true })
|
||||
execFileSync(makeappx, ['bundle', '/o', '/bv', version, '/d', staging, '/p', bundle], {
|
||||
stdio: ['ignore', 'ignore', 'inherit'] // stdout stays clean: the path is the machine-readable result
|
||||
})
|
||||
fs.rmSync(staging, { recursive: true, force: true })
|
||||
|
||||
// stdout = the absolute bundle path, the ONLY thing the workflow reads back.
|
||||
console.log(bundle)
|
||||
@@ -40,6 +40,76 @@ export function contentTypeFor(filename) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
// ── makeappx / signtool resolution (SDK BuildTools nuget) ─────────────────
|
||||
// electron-builder downloads Microsoft.Windows.SDK.BuildTools into its
|
||||
// winCodeSign cache; the bundle jobs use the SAME pin so makeappx/signtool
|
||||
// match the builder's. Shared by stage-msixbundle.mjs (out-of-store feed) and
|
||||
// bundle-store-msixbundle.mjs (Store-submission bundle) — one resolver.
|
||||
export function resolveWinSdkTools() {
|
||||
// electron-builder downloads its signing toolsets into the cache root
|
||||
// (ELECTRON_BUILDER_CACHE on CI, %LOCALAPPDATA%/electron-builder/Cache
|
||||
// by default) under `win-codesign@<ver>/` — there is NO `winCodeSign`
|
||||
// subdir. The Windows Kits bundle extracts to
|
||||
// win-codesign@<ver>/windows-kits-bundle-10_0_26100_0-<hash>/ with the
|
||||
// HOST tools (signtool.exe + makeappx.exe) in its x64/ subdir. Legacy
|
||||
// winCodeSign-2.6.0 used windows-10/<arch>/; the old nuget layout
|
||||
// bin/<ver>/x64/ is long gone.
|
||||
const roots = [
|
||||
process.env.ELECTRON_BUILDER_CACHE || '',
|
||||
path.join(process.env.LOCALAPPDATA || '', 'electron-builder', 'Cache'),
|
||||
path.join(process.env.LOCALAPPDATA || '', 'electron-builder', 'cache'),
|
||||
path.join(process.env.USERPROFILE || '', 'AppData', 'Local', 'electron-builder', 'Cache')
|
||||
]
|
||||
for (const root of roots) {
|
||||
if (!root || !fs.existsSync(root)) continue
|
||||
for (const entry of fs.readdirSync(root)) {
|
||||
const dir = path.join(root, entry)
|
||||
if (!fs.statSync(dir).isDirectory()) continue
|
||||
// Modern electron-builder (win-codesign@1.x): the Windows Kits bundle
|
||||
// extracts to <cacheDir>/win-codesign@<ver>/windows-kits-bundle-10_0_26100_0-<hash>/,
|
||||
// with the HOST tools (signtool.exe + makeappx.exe) directly in the
|
||||
// x64/ subdir of the bundle folder — two levels under the cache root.
|
||||
// Legacy winCodeSign-2.6.0 used windows-10/<arch>/ under the toolset
|
||||
// dir; the old nuget layout bin/<ver>/x64/ is gone. Check every dir
|
||||
// two levels down that carries a makeappx.exe + signtool.exe.
|
||||
const toolDirs = []
|
||||
for (const sub of fs.readdirSync(dir)) {
|
||||
const subDir = path.join(dir, sub)
|
||||
if (!fs.statSync(subDir).isDirectory()) continue
|
||||
for (const arch of ['x64']) {
|
||||
const x64 = path.join(subDir, arch)
|
||||
if (fs.existsSync(path.join(x64, 'makeappx.exe')) && fs.existsSync(path.join(x64, 'signtool.exe'))) {
|
||||
toolDirs.push(x64)
|
||||
}
|
||||
}
|
||||
// Legacy: windows-10/x64 (winCodeSign-2.6.0)
|
||||
const win10 = path.join(subDir, 'windows-10', 'x64')
|
||||
if (fs.existsSync(path.join(win10, 'makeappx.exe')) && fs.existsSync(path.join(win10, 'signtool.exe'))) {
|
||||
toolDirs.push(win10)
|
||||
}
|
||||
// Legacy nuget: bin/<ver>/x64
|
||||
const binDir = path.join(subDir, 'bin')
|
||||
if (fs.existsSync(binDir)) {
|
||||
for (const bsub of fs.readdirSync(binDir)) {
|
||||
const x64 = path.join(binDir, bsub, 'x64')
|
||||
if (fs.existsSync(path.join(x64, 'makeappx.exe')) && fs.existsSync(path.join(x64, 'signtool.exe'))) {
|
||||
toolDirs.push(x64)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// First root with a usable kit wins — the configured
|
||||
// ELECTRON_BUILDER_CACHE must beat any stray default cache.
|
||||
if (toolDirs.length > 0) {
|
||||
toolDirs.sort()
|
||||
return toolDirs[toolDirs.length - 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
console.error('[resolveWinSdkTools] no makeappx/signtool found under electron-builder winCodeSign cache')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
function escapeAttr(value) {
|
||||
return String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')
|
||||
}
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
// releases/tag/<tag>/<filename> immutable per-release staging/archive
|
||||
// releases/win32/<channel>/<channel>.appinstaller App Installer feed
|
||||
// releases/win32/<channel>/*.msixbundle (produced by the
|
||||
// msixbundle job)
|
||||
// publish-win32-updater job)
|
||||
// releases/darwin/<channel>/<channel>-mac.yml electron-updater feed
|
||||
// releases/darwin/<channel>/*.{dmg,zip,blockmap}
|
||||
// where <channel> is stable | nightly (from the tag: -nightly. → nightly).
|
||||
// The finalize job merges the matrix legs' staging into these feeds.
|
||||
// The publish-win32-updater job merges the win32 legs' staging into the
|
||||
// win32 feed; the darwin feed merge (r2 finalize) is currently DISABLED
|
||||
// (no macOS updater arm).
|
||||
|
||||
import { createHash, createHmac } from 'node:crypto'
|
||||
import fs from 'node:fs'
|
||||
|
||||
@@ -27,7 +27,7 @@ import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import { appIdentity, buildAppInstaller } from './msix-shared.mjs'
|
||||
import { appIdentity, buildAppInstaller, resolveWinSdkTools } from './msix-shared.mjs'
|
||||
|
||||
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
|
||||
@@ -81,80 +81,6 @@ function bundleFile() {
|
||||
return path.join(releaseDir, `${name}-${version}-win.msixbundle`)
|
||||
}
|
||||
|
||||
// ── makeappx / signtool resolution (SDK BuildTools nuget) ──────────────────
|
||||
// electron-builder downloads Microsoft.Windows.SDK.BuildTools into its winCodeSign
|
||||
// cache; this job uses the SAME pin so makeappx/signtool match the builder's.
|
||||
function resolveWinSdkTools() {
|
||||
const candidates = []
|
||||
// electron-builder downloads its signing toolsets into the cache root
|
||||
// (ELECTRON_BUILDER_CACHE on CI, %LOCALAPPDATA%/electron-builder/Cache
|
||||
// by default) under `win-codesign@<ver>/` — there is NO `winCodeSign`
|
||||
// subdir. The Windows Kits bundle extracts to
|
||||
// win-codesign@<ver>/windows-kits-bundle-10_0_26100_0-<hash>/ with the
|
||||
// HOST tools (signtool.exe + makeappx.exe) in its x64/ subdir. Legacy
|
||||
// winCodeSign-2.6.0 used windows-10/<arch>/; the old nuget layout
|
||||
// bin/<ver>/x64/ is long gone.
|
||||
const roots = [
|
||||
process.env.ELECTRON_BUILDER_CACHE || '',
|
||||
path.join(process.env.LOCALAPPDATA || '', 'electron-builder', 'Cache'),
|
||||
path.join(process.env.LOCALAPPDATA || '', 'electron-builder', 'cache'),
|
||||
path.join(process.env.USERPROFILE || '', 'AppData', 'Local', 'electron-builder', 'Cache')
|
||||
]
|
||||
for (const root of roots) {
|
||||
if (!root || !fs.existsSync(root)) continue
|
||||
for (const entry of fs.readdirSync(root)) {
|
||||
const dir = path.join(root, entry)
|
||||
if (!fs.statSync(dir).isDirectory()) continue
|
||||
// Modern electron-builder (win-codesign@1.x): the Windows Kits bundle
|
||||
// extracts to <cacheDir>/win-codesign@<ver>/windows-kits-bundle-10_0_26100_0-<hash>/,
|
||||
// with the HOST tools (signtool.exe + makeappx.exe) directly in the
|
||||
// x64/ subdir of the bundle folder — two levels under the cache root.
|
||||
// Legacy winCodeSign-2.6.0 used windows-10/<arch>/ under the toolset
|
||||
// dir; the old nuget layout bin/<ver>/x64/ is gone. Check every dir
|
||||
// two levels down that carries a makeappx.exe + signtool.exe.
|
||||
const toolDirs = []
|
||||
for (const sub of fs.readdirSync(dir)) {
|
||||
const subDir = path.join(dir, sub)
|
||||
if (!fs.statSync(subDir).isDirectory()) continue
|
||||
for (const arch of ['x64']) {
|
||||
const x64 = path.join(subDir, arch)
|
||||
if (fs.existsSync(path.join(x64, 'makeappx.exe')) && fs.existsSync(path.join(x64, 'signtool.exe'))) {
|
||||
toolDirs.push(x64)
|
||||
}
|
||||
}
|
||||
// Legacy: windows-10/x64 (winCodeSign-2.6.0)
|
||||
const win10 = path.join(subDir, 'windows-10', 'x64')
|
||||
if (fs.existsSync(path.join(win10, 'makeappx.exe')) && fs.existsSync(path.join(win10, 'signtool.exe'))) {
|
||||
toolDirs.push(win10)
|
||||
}
|
||||
// Legacy nuget: bin/<ver>/x64
|
||||
const binDir = path.join(subDir, 'bin')
|
||||
if (fs.existsSync(binDir)) {
|
||||
for (const bsub of fs.readdirSync(binDir)) {
|
||||
const x64 = path.join(binDir, bsub, 'x64')
|
||||
if (fs.existsSync(path.join(x64, 'makeappx.exe')) && fs.existsSync(path.join(x64, 'signtool.exe'))) {
|
||||
toolDirs.push(x64)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// First root with a usable kit wins — the configured
|
||||
// ELECTRON_BUILDER_CACHE must beat any stray default cache.
|
||||
if (toolDirs.length > 0) {
|
||||
toolDirs.sort()
|
||||
return toolDirs[toolDirs.length - 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (candidates.length === 0) {
|
||||
console.error('[stage-msixbundle] no makeappx/signtool found under electron-builder winCodeSign cache')
|
||||
process.exit(1)
|
||||
}
|
||||
// Prefer the newest SDK build.
|
||||
candidates.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
|
||||
return candidates[candidates.length - 1]
|
||||
}
|
||||
|
||||
const winSdk = resolveWinSdkTools()
|
||||
const makeappx = path.join(winSdk, 'makeappx.exe')
|
||||
const signtool = path.join(winSdk, 'signtool.exe')
|
||||
|
||||
Reference in New Issue
Block a user