Skip to content

The agent that grows with you

ci(desktop): re-enable the Windows Store submission with nightly flights

ethernet65d0f03e5247
diff --git a/.github/workflows/desktop-bundled-release.yml b/.github/workflows/desktop-bundled-release.yml
index afb3b1f30f2..4e45e58707a 100644
--- a/.github/workflows/desktop-bundled-release.yml
+++ b/.github/workflows/desktop-bundled-release.yml
@@ -15,9 +15,12 @@ name: Desktop Bundled Release
# publish-win32-updater → App Installer feed
# (needs build-win32): releases/win32/<stable|nightly>/*.appinstaller +
# *.msixbundle (stage-msixbundle.mjs --variant bundled)
-# publish-win32-store → DISABLED for now (dummy skip —
-# the Store submission + store variant build are turned off; app
-# installer is the update path)
+# publish-win32-store → Windows Store submission
+# (needs build-win32, PARALLEL with the updater feed): bundle the two
+# Store-*.msix into one universal Store .msixbundle and submit via the
+# MSStore CLI. Stable → production; nightly → package flight ring
+# (delete-then-replace, newest always wins). Gated on MS_STORE_PRODUCT_ID
+# (+ MS_STORE_NIGHTLY_FLIGHT_ID for the nightly arm).
# publish-darwin-updater → DISABLED (dummy skip — the
# darwin electron-updater arm was removed; nothing publishes a mac feed)
#
@@ -48,15 +51,16 @@ name: Desktop Bundled Release
# 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): DISABLED for now — the job
-# is a dummy skip and the store variant build is turned off. App installer
-# (releases/win32/<channel>/) is the update path. When re-enabling, the flow
-# is the MSStore CLI (microsoft/microsoft-store-apppublisher) with the
-# credentials in the release-signing environment:
+# Windows Store submission (publish-win32-store): 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)
-# msstore reconfigure → msstore publish <Store-*.msixbundle> -id
+# vars: MS_STORE_PRODUCT_ID (the Partner Center product ID),
+# MS_STORE_NIGHTLY_FLIGHT_ID (package flight for nightlies —
+# optional; without it nightlies skip the store)
+# msstore reconfigure → (delete pending) → msstore publish
+# <Store-*.msixbundle> (-f <flightId> for nightlies) -id <productId>
# The Store bundle is UNSIGNED on purpose — Partner Center re-signs on
# ingestion (see sign-msix.mjs).
@@ -390,11 +394,11 @@ jobs:
AZURE_TOKEN_CREDENTIALS: prod
run: |
node scripts/build-bundled-desktop.mjs --tag="$HERMES_PAYLOAD_TAG" --variant=bundled
- # The Store-submission variant build is DISABLED for now (publish-win32-store
- # is a dummy skip). Re-enable: re-pack the same bundled payload with the
- # Partner Center identity, bundle the two Store-*.msix into a universal
- # Store .msixbundle (scripts/bundle-store-msixbundle.mjs), and submit via
- # the MSStore CLI — see the commit that added the flow.
+ # The Store-submission MSIX is the same bundled payload re-packed
+ # 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
@@ -419,15 +423,27 @@ jobs:
shell: bash
# Every artifact goes to releases/tag/<tag>/ (immutable staging).
# publish-win32-updater consumes the per-arch .msix to build the App
- # Installer feed after the whole win32 matrix is green — never from a
- # leg, so a failed leg cannot publish a partial feed.
+ # Installer feed; publish-win32-store bundles the Store-*.msix — 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/*.msix)
if [ ${#files[@]} -eq 0 ]; then
echo "::error::no release artifacts found"; exit 1
fi
for f in "${files[@]}"; do
+ case "$f" in
+ */Store-*) continue ;; # archived by the Store loop below
+ esac
+ node scripts/r2-release.mjs put \
+ --tag "$HERMES_PAYLOAD_TAG" --key "$(basename "$f")" --file "$f"
+ done
+ # The Store-submission MSIX (built by the win legs) goes to the tag
+ # archive too — hidden from the builds table and never a feed dir.
+ for f in apps/desktop/release/Store-*.msix; do
+ [ -f "$f" ] || continue
node scripts/r2-release.mjs put \
--tag "$HERMES_PAYLOAD_TAG" --key "$(basename "$f")" --file "$f"
done
@@ -591,25 +607,165 @@ jobs:
# .msix to the tag archive (never a feed dir).
node scripts/stage-msixbundle.mjs --tag "$HERMES_PAYLOAD_TAG" --variant bundled
- # ── Windows Store submission (DISABLED for now — dummy skip) ──────────────
- # The Store-submission flow (bundle Store-*.msix → universal Store
- # .msixbundle → msstore publish) is turned off, and the store variant build
- # in build-win32 is disabled with it. The App Installer feed
- # (publish-win32-updater) is the update path. Kept as a dummy success so
- # the dependency graph stays green. Re-enable: restore the store variant
- # build step in build-win32, then rebuild this job from the MSStore CLI
- # steps removed in this commit (bundle-store-msixbundle.mjs is still in the
- # tree, and the original flow lives in the commit that added it).
+ # ── 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 via the MSStore CLI.
+ #
+ # stable tags → production submission (msstore publish -id)
+ # nightly tags → package flight ring (msstore publish -f <flightId>),
+ # delete-then-replace: any pending flight submission is
+ # deleted first so the newest nightly always wins the
+ # single-slot submission queue (chosen over skip-if-pending
+ # — always ship the newest, at the cost of cert churn).
+ #
+ # Gating: runs for stable whenever MS_STORE_PRODUCT_ID is set; runs for
+ # nightly only when MS_STORE_NIGHTLY_FLIGHT_ID is ALSO set (so the flight
+ # ring stays off until the flight exists in Partner Center).
publish-win32-store:
- name: Publish the Store submission to the Windows Store (disabled for now)
+ name: Publish the Windows Store submission (production + nightly flight)
needs: [validate, build-win32]
- if: inputs.upload_release == true
- runs-on: ubuntu-24.04
- timeout-minutes: 5
+ if: |
+ inputs.upload_release == true
+ && vars.MS_STORE_PRODUCT_ID != ''
+ && (contains(inputs.tag, '-nightly.') == false || vars.MS_STORE_NIGHTLY_FLIGHT_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 }}
+ MS_STORE_NIGHTLY_FLIGHT_ID: ${{ vars.MS_STORE_NIGHTLY_FLIGHT_ID }}
steps:
- - name: Disabled
+ - 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/[email protected] # 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: echo "::notice::Windows Store submission is disabled for now — app installer feeds (publish-win32-updater) are the update path; re-enable the MSStore CLI flow when ready"
+ 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.
+ #
+ # delete-then-replace (chosen over skip-if-pending): Partner Center
+ # allows ONE pending submission per app/flight at a time, so clear
+ # any in-flight draft before publishing — the newest nightly always
+ # wins the queue. A missing pending submission errors the delete,
+ # which is fine (nothing to clear) — only the publish gates the job.
+ bundle="${{ steps.storebundle.outputs.bundle }}"
+ if [[ "$HERMES_PAYLOAD_TAG" == *-nightly.* ]]; then
+ echo "nightly tag → package flight '$MS_STORE_NIGHTLY_FLIGHT_ID'"
+ msstore flights submission delete "$MS_STORE_PRODUCT_ID" "$MS_STORE_NIGHTLY_FLIGHT_ID" --no-confirm \
+ || echo "no pending flight submission to clear"
+ msstore publish "$bundle" -f "$MS_STORE_NIGHTLY_FLIGHT_ID" -id "$MS_STORE_PRODUCT_ID"
+ else
+ echo "stable tag → production submission"
+ msstore submission delete "$MS_STORE_PRODUCT_ID" --no-confirm \
+ || echo "no pending submission to clear"
+ msstore publish "$bundle" -id "$MS_STORE_PRODUCT_ID"
+ fi
# ── macOS updater channel (DISABLED — dummy skip) ─────────────────────────
# No macOS updater arm exists (darwin electron-updater was removed in
diff --git a/scripts/stage-msixbundle.mjs b/scripts/stage-msixbundle.mjs
index 0901355a176..794610a3d79 100644
--- a/scripts/stage-msixbundle.mjs
+++ b/scripts/stage-msixbundle.mjs
@@ -16,8 +16,6 @@
// 2. STORE ARCHIVE: re-upload the Store-submission .msix files (built by
// the win legs, prefixed Store-) to the tag archive. The Store is the
// distribution for those — they never touch a feed dir.
-// NOTE: the store variant build is currently DISABLED (publish-win32-store
-// is a dummy skip), so this step has no inputs until it is re-enabled.
//
// Usage (win runner, bash):
// node scripts/stage-msixbundle.mjs --tag vX.Y.Z [--variant bundled|light]