Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
ci(cua-driver): rebuild_tag dispatch to republish an existing draft tag (#6606)
cua-agents[bot]a6023f59eaec
diff --git a/.github/scripts/tests/test_cua_driver_release_safety_wiring.py b/.github/scripts/tests/test_cua_driver_release_safety_wiring.pyindex 368ec96bc8..63b7bf7f45 100644--- a/.github/scripts/tests/test_cua_driver_release_safety_wiring.py+++ b/.github/scripts/tests/test_cua_driver_release_safety_wiring.py@@ -25,13 +25,17 @@ REPO_ROOT = Path(__file__).resolve().parents[3]CD = REPO_ROOT / ".github/workflows/cd-rust-cua-driver.yml"SIGNATURES = REPO_ROOT / ".github/workflows/cua-driver-release-signatures.yml"SELF_TEST = REPO_ROOT / ".github/workflows/ci-cua-driver-release-signatures.yml"-DO_NOTARIZE = "${{ startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs.notarize == true }}"-# Only the Release Please tag push can publish; there is no manual publish input.-TAG_PUSH = "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')"+# Publishing happens only on the Release Please tag push, or on a workflow_dispatch+# from main that rebuilds an existing stable tag (rebuild_tag); there is no publish input.+TAG_PUSH = (+ "((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) "+ "|| (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))"+)+DO_NOTARIZE = "${{ " + TAG_PUSH + " || inputs.notarize == true }}"CAN_PUBLISH = "${{ " + TAG_PUSH + " }}"E2E_GATES = {"e2e-linux", "e2e-windows", "e2e-macos", "e2e-standalone-browsers"}# The same suites gate the stable tag push and nightly builds.-E2E_GATE_IF = f"({TAG_PUSH}) || inputs.channel == 'nightly'"+E2E_GATE_IF = f"{TAG_PUSH} || inputs.channel == 'nightly'"SIGNATURE_GATES = {"verify-macos-release-signatures", "verify-windows-release-signatures"}STATUS_OVERRIDES = ("always()", "failure()", "cancelled()", "!cancelled()")@@ -83,7 +87,7 @@ def test_macos_build_notarizes_every_tag_build(cd: dict) -> None:first = build["steps"][0]assert first["name"] == "Assert notarization for publishable builds"assert first["env"]["CAN_PUBLISH"] == CAN_PUBLISH- assert '"$GITHUB_REF" == refs/tags/cua-driver-rs-v* && "$DO_NOTARIZE" != "true"' in first["run"]+ assert '"$RELEASE_REF" == refs/tags/cua-driver-rs-v* && "$DO_NOTARIZE" != "true"' in first["run"]assert '"$CAN_PUBLISH" == "true" && "$DO_NOTARIZE" != "true"' in first["run"]# Signing and notarization steps are all keyed on the same switch.for name in (diff --git a/.github/scripts/tests/test_cua_driver_release_wiring.py b/.github/scripts/tests/test_cua_driver_release_wiring.pyindex f7aa26985f..66986d8dc9 100644--- a/.github/scripts/tests/test_cua_driver_release_wiring.py+++ b/.github/scripts/tests/test_cua_driver_release_wiring.py@@ -839,7 +839,9 @@ fi# Every candidate build checks out the tag (or the nightly source ref);# there is no dispatch path that retargets an older tag for publication.- self.assertEqual(workflow.count("ref: ${{ inputs.source_ref || github.ref }}"), 6)+ self.assertEqual(+ workflow.count("ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}"), 6+ )self.assertNotIn("inputs.publish", workflow)self.assertNotIn("format('refs/tags/cua-driver-rs-v{0}', inputs.version)", workflow)self.assertIn(@@ -951,8 +953,9 @@ fidef test_driver_tag_push_publishes_only_after_automatic_e2e_gate(self) -> None:workflow = self.read(".github/workflows/cd-rust-cua-driver.yml")tag_push = (- "github.event_name == 'push' && "- "startsWith(github.ref, 'refs/tags/cua-driver-rs-v')"+ "((github.event_name == 'push' && "+ "startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || "+ "(github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))")# No manual publish input or dispatch path exists.@@ -964,7 +967,9 @@ fi# The Release Please tag push calls every canonical hosted E2E suite# against the exact tag SHA, after the attribution preflight. Nightly# builds call the same suites against their exact source_ref.- gate_sha = "${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}"+ gate_sha = (+ "${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}"+ )gates = {"e2e-linux": ("e2e-rust-linux.yml", f"ref: {gate_sha}"),"e2e-windows": ("e2e-rust-windows.yml", f"ref: {gate_sha}"),@@ -977,7 +982,7 @@ fifor job, (called, sha_input) in gates.items():block = workflow.split(f"\n {job}:\n", 1)[1].split("\n\n", 1)[0]self.assertIn(" needs: release-attribution-preflight\n", block)- self.assertIn(f" if: ({tag_push}) || inputs.channel == 'nightly'\n", block)+ self.assertIn(f" if: {tag_push} || inputs.channel == 'nightly'\n", block)self.assertIn(f" uses: ./.github/workflows/{called}\n", block)self.assertIn(sha_input, block)self.assertIn(" actions: read\n", block)@@ -1004,8 +1009,8 @@ fiself.assertIn(f" - {job}\n", needs)self.assertIn(f" if: {tag_push}\n", needs)self.assertNotIn("always()", needs)- self.assertIn("ref: ${{ github.ref }}", steps)- self.assertIn('if [[ "$SHA" != "$GITHUB_SHA" ]]; then', steps)+ self.assertIn("ref: ${{ env.RELEASE_REF }}", steps)+ self.assertIn('if [[ "$SHA" != "$CERTIFIED_SHA" ]]; then', steps)# E2E evidence shares the run, so release-bound downloads are scoped.self.assertIn('pattern: "{cua-driver-rs-*,cua-hyprland-plugin-source}"', steps)diff --git a/.github/scripts/tests/test_nightly_release_wiring.py b/.github/scripts/tests/test_nightly_release_wiring.pyindex 49f6fb7488..efb713ef7f 100644--- a/.github/scripts/tests/test_nightly_release_wiring.py+++ b/.github/scripts/tests/test_nightly_release_wiring.py@@ -6,7 +6,10 @@ from pathlib import PathROOT = Path(__file__).resolve().parents[3]WORKFLOWS = ROOT / ".github/workflows"-TAG_PUSH = "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')"+TAG_PUSH = (+ "((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) "+ "|| (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))"+)def source(name: str) -> str:@@ -17,12 +20,9 @@ def test_driver_stable_publish_gate_and_workflow_name_are_frozen():driver = source("cd-rust-cua-driver.yml")assert driver.startswith('name: "CD: Cua Driver (cross-platform)"')release = driver.split("\n release:\n", 1)[1].split(" steps:\n", 1)[0]- # Only the stable tag push publishes. Nightly workflow_call runs inherit+ # Only the stable tag push, or a main-dispatched rebuild of an existing stable tag, publishes. Nightly workflow_call runs inherit# the caller's schedule/workflow_dispatch event and can never match.- assert (- " if: github.event_name == 'push' && "- "startsWith(github.ref, 'refs/tags/cua-driver-rs-v')\n"- ) in release+ assert f" if: {TAG_PUSH}\n" in releaseassert "inputs.publish" not in driversdk = source("cd-py-cua-driver.yml")assert 'workflows: ["CD: Cua Driver (cross-platform)"]' in sdk@@ -42,7 +42,9 @@ def test_driver_nightly_publishes_only_after_the_desktop_e2e_gate():build = nightly.split("\n build:\n", 1)[1].split("\n\n", 1)[0]assert " channel: nightly\n" in buildassert " source_ref: ${{ inputs.source_sha || github.sha }}\n" in build- gate_sha = "${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}"+ gate_sha = (+ "${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}"+ )for job, sha_input in (("e2e-linux", "ref"),("e2e-windows", "ref"),@@ -50,7 +52,7 @@ def test_driver_nightly_publishes_only_after_the_desktop_e2e_gate():("e2e-standalone-browsers", "ref"),):block = driver.split(f"\n {job}:\n", 1)[1].split("\n\n", 1)[0]- assert f" if: ({TAG_PUSH}) || inputs.channel == 'nightly'\n" in block+ assert f" if: {TAG_PUSH} || inputs.channel == 'nightly'\n" in blockassert f"\n {sha_input}: {gate_sha}" in block# A failed suite fails the reusable build, and publish requires a# successful build with no status-function bypass.diff --git a/.github/workflows/cd-rust-cua-driver.yml b/.github/workflows/cd-rust-cua-driver.ymlindex 61e7ba0e8f..0c0db548ad 100644--- a/.github/workflows/cd-rust-cua-driver.yml+++ b/.github/workflows/cd-rust-cua-driver.yml@@ -40,6 +40,16 @@ on:required: falsedefault: truetype: boolean+ rebuild_tag:+ description: "Unused by callers; declared so the inputs context matches workflow_dispatch"+ required: false+ default: ""+ type: string+ rebuild_sha:+ description: "Unused by callers; declared so the inputs context matches workflow_dispatch"+ required: false+ default: ""+ type: stringsecrets:APPLICATION_CERT_BASE64:required: false@@ -73,6 +83,14 @@ on:required: falsetype: booleandefault: true+ rebuild_tag:+ description: "Rebuild and publish the existing draft release of this tag (e.g. cua-driver-rs-v0.39.0) with THIS ref's workflow files. Run from main. Leave empty for a build-only candidate."+ required: false+ default: ""+ rebuild_sha:+ description: "Commit SHA the tag points to (required with rebuild_tag; checked against the tag)"+ required: false+ default: ""permissions:contents: write@@ -81,10 +99,16 @@ permissions:pull-requests: readconcurrency:- group: cd-cua-driver-${{ github.ref }}+ group: cd-cua-driver-${{ inputs.rebuild_tag && format('refs/tags/{0}', inputs.rebuild_tag) || github.ref }}cancel-in-progress: falseenv:+ # The release ref this run is about: the pushed tag or, for a rebuild+ # dispatch (run from main so fixed workflow files apply to an existing tag),+ # the requested tag. Shell steps read RELEASE_REF instead of GITHUB_REF and+ # CERTIFIED_SHA instead of GITHUB_SHA.+ RELEASE_REF: ${{ inputs.rebuild_tag && format('refs/tags/{0}', inputs.rebuild_tag) || github.ref }}+ CERTIFIED_SHA: ${{ inputs.rebuild_sha || github.sha }}CARGO_NET_RETRY: "10"CARGO_HTTP_TIMEOUT: "120"CARGO_HTTP_MULTIPLEXING: "false"@@ -108,8 +132,8 @@ jobs:# install. Fail before any build instead of discovering it afterwards.- name: Refuse to publish without macOS notarizationenv:- CAN_PUBLISH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v') }}- DO_NOTARIZE: ${{ startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs.notarize == true }}+ CAN_PUBLISH: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) }}+ DO_NOTARIZE: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.notarize == true }}run: |echo "can publish: ${CAN_PUBLISH}; notarize macOS: ${DO_NOTARIZE}"if [[ "$CAN_PUBLISH" == "true" && "$DO_NOTARIZE" != "true" ]]; then@@ -117,6 +141,37 @@ jobs:exit 1fi+ # Rebuild dispatch guard: only main's workflow files, only an existing+ # draft, only the exact tagged commit. Nothing here moves or re-creates+ # a tag, and a published release is refused so no duplicate can ship.+ - name: Validate rebuild request+ if: ${{ inputs.rebuild_tag != '' }}+ env:+ GH_TOKEN: ${{ github.token }}+ REBUILD_TAG: ${{ inputs.rebuild_tag }}+ REBUILD_SHA: ${{ inputs.rebuild_sha }}+ EVENT: ${{ github.event_name }}+ WORKFLOW_REF: ${{ github.ref }}+ NOTARIZE: ${{ inputs.notarize }}+ run: |+ set -euo pipefail+ [[ "$EVENT" == "workflow_dispatch" && "$WORKFLOW_REF" == "refs/heads/main" ]] \+ || { echo "::error::rebuild_tag is only allowed on a workflow_dispatch from main"; exit 1; }+ [[ "$REBUILD_TAG" =~ ^cua-driver-rs-v[0-9]+\.[0-9]+\.[0-9]+$ ]] \+ || { echo "::error::rebuild_tag must be a stable cua-driver-rs-vX.Y.Z tag"; exit 1; }+ [[ "$REBUILD_SHA" =~ ^[0-9a-f]{40}$ ]] \+ || { echo "::error::rebuild_sha must be a full lowercase commit SHA"; exit 1; }+ [[ "$NOTARIZE" == "true" ]] \+ || { echo "::error::a rebuild that publishes must notarize"; exit 1; }+ TAG_SHA=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${REBUILD_TAG}" --jq .sha)+ [[ "$TAG_SHA" == "$REBUILD_SHA" ]] \+ || { echo "::error::$REBUILD_TAG resolves to $TAG_SHA, not $REBUILD_SHA"; exit 1; }+ DRAFT=$(gh api "repos/${GITHUB_REPOSITORY}/releases?per_page=100" --paginate \+ --jq ".[] | select(.tag_name == \"${REBUILD_TAG}\") | .draft")+ [[ "$DRAFT" == "true" ]] \+ || { echo "::error::no unpublished draft release for $REBUILD_TAG (already published or missing); refusing to rebuild"; exit 1; }+ echo "Rebuilding $REBUILD_TAG at $REBUILD_SHA from main's workflow files." >> "$GITHUB_STEP_SUMMARY"+- name: Resolve candidate versionid: candidateenv:@@ -125,8 +180,8 @@ jobs:run: |if [[ "$CHANNEL" == "nightly" ]]; thenVERSION="$INPUT_VERSION"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="$INPUT_VERSION"fi@@ -135,7 +190,7 @@ jobs:- uses: actions/checkout@v4with:fetch-depth: 0- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- name: Check out release control toolinguses: actions/checkout@v4@@ -149,8 +204,8 @@ jobs:GH_TOKEN: ${{ github.token }}run: |set -euo pipefail- if [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ if [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseecho "No immutable release candidate requested; skipping attribution preflight."exit 0@@ -288,7 +343,7 @@ jobs:fi- uses: actions/checkout@v4with:- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- name: Stage nightly artifact versionif: inputs.channel == 'nightly'run: python3 .github/scripts/release_channels.py apply-version --component cua-driver-rs --version "${{ inputs.version }}"@@ -303,8 +358,8 @@ jobs:run: |if [[ "${{ inputs.channel }}" == "nightly" ]]; thenVERSION="${{ inputs.version }}"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="${{ inputs.version }}"fi@@ -380,7 +435,7 @@ jobs:steps:- uses: actions/checkout@v4with:- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- name: Stage nightly artifact versionif: inputs.channel == 'nightly'shell: bash@@ -396,8 +451,8 @@ jobs:run: |if [[ "${{ inputs.channel }}" == "nightly" ]]; thenVERSION="${{ inputs.version }}"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="${{ inputs.version }}"fi@@ -564,7 +619,7 @@ jobs:steps:- uses: actions/checkout@v4with:- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- uses: actions/setup-node@v4with:node-version: "22"@@ -627,14 +682,14 @@ jobs:# `notarize` input so we can iterate on the build pipeline without# touching the Apple notary service.env:- DO_NOTARIZE: ${{ startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs.notarize == true }}+ DO_NOTARIZE: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.notarize == true }}KEYCHAIN_PASSWORD: temporary-cd-keychain-pwdsteps:- name: Assert notarization for publishable buildsenv:- CAN_PUBLISH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v') }}+ CAN_PUBLISH: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) }}run: |- if [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* && "$DO_NOTARIZE" != "true" ]]; then+ if [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* && "$DO_NOTARIZE" != "true" ]]; thenecho "::error title=Release safety::Tag builds must notarize the macOS artifacts."exit 1fi@@ -645,7 +700,7 @@ jobs:echo "notarize macOS: ${DO_NOTARIZE}"- uses: actions/checkout@v4with:- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- name: Preflight Computer History provisioning profileif: env.DO_NOTARIZE == 'true'env:@@ -704,8 +759,8 @@ jobs:run: |if [[ "${{ inputs.channel }}" == "nightly" ]]; thenVERSION="${{ inputs.version }}"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="${{ inputs.version }}"fi@@ -1040,14 +1095,13 @@ jobs:name: pinned Hyprland plugin sourceneeds: release-attribution-preflightif: >-- github.event_name == 'push' &&- startsWith(github.ref, 'refs/tags/cua-driver-rs-v')+ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4with:fetch-depth: 0- ref: ${{ inputs.source_ref || github.ref }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.ref }}- uses: actions/setup-python@v5with:python-version: "3.12"@@ -1057,8 +1111,8 @@ jobs:REQUESTED_VERSION: ${{ inputs.version }}run: |set -euo pipefail- if [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ if [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="$REQUESTED_VERSION"fi@@ -1100,15 +1154,15 @@ jobs:with:# Candidate artifacts come from the exact source; the verifier comes# from the commit that defined this workflow run.- ref: ${{ inputs.source_ref || github.workflow_sha }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.workflow_sha }}- name: Determine versionid: versionrun: |if [[ "${{ inputs.channel }}" == "nightly" ]]; thenVERSION="${{ inputs.version }}"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="${{ inputs.version }}"fi@@ -1139,7 +1193,7 @@ jobs:steps:- uses: actions/checkout@v4with:- ref: ${{ inputs.source_ref || github.workflow_sha }}+ ref: ${{ inputs.rebuild_sha || inputs.source_ref || github.workflow_sha }}- uses: actions/setup-node@v4with:node-version: "22"@@ -1151,8 +1205,8 @@ jobs:run: |if [[ "${{ inputs.channel }}" == "nightly" ]]; thenVERSION="${{ inputs.version }}"- elif [[ "$GITHUB_REF" == refs/tags/cua-driver-rs-v* ]]; then- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ elif [[ "$RELEASE_REF" == refs/tags/cua-driver-rs-v* ]]; then+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"elseVERSION="${{ inputs.version }}"fi@@ -1203,47 +1257,47 @@ jobs:e2e-linux:name: release gate / Linux E2Eneeds: release-attribution-preflight- if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.channel == 'nightly'permissions:actions: readcontents: readuses: ./.github/workflows/e2e-rust-linux.ymlwith:- ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}e2e-windows:name: release gate / Windows E2Eneeds: release-attribution-preflight- if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.channel == 'nightly'permissions:actions: readcontents: readuses: ./.github/workflows/e2e-rust-windows.ymlwith:- ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}e2e-macos:name: release gate / macOS hosted E2Eneeds: release-attribution-preflight- if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.channel == 'nightly'permissions:actions: readcontents: readpull-requests: readuses: ./.github/workflows/e2e-rust-macos.ymlwith:- source_sha: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}+ source_sha: ${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}e2e-standalone-browsers:name: release gate / standalone browser E2Eneeds: release-attribution-preflight- if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || inputs.channel == 'nightly'+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.channel == 'nightly'permissions:actions: readcontents: readuses: ./.github/workflows/e2e-rust-standalone-browsers.ymlwith:- ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || github.sha }}+ ref: ${{ inputs.channel == 'nightly' && inputs.source_ref || inputs.rebuild_sha || github.sha }}# ── Release signature gate ──────────────────────────────────────────────────# Release safety (#4109): verify the exact uploaded archives the way the@@ -1255,7 +1309,7 @@ jobs:verify-macos-release-signatures:name: macOS release signaturesneeds: [release-attribution-preflight, build-macos-universal]- if: startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs.notarize == true+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.notarize == trueuses: ./.github/workflows/cua-driver-release-signatures.ymlwith:version: ${{ needs.release-attribution-preflight.outputs.version }}@@ -1287,7 +1341,7 @@ jobs:# the gate times out and the smoke is started by hand as before.request-staging-smoke:name: Request the staging smoke- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))runs-on: ubuntu-latesttimeout-minutes: 5permissions:@@ -1307,7 +1361,7 @@ jobs:- name: Send the cua-release-candidate dispatchenv:GH_TOKEN: ${{ steps.app-token.outputs.token }}- run: .github/scripts/request_staging_smoke.sh cua-driver "$GITHUB_SHA"+ run: .github/scripts/request_staging_smoke.sh cua-driver "$CERTIFIED_SHA"# Staging first (CUA-1907): a release publishes only when the staging smoke# is recorded green for this exact commit as the commit status@@ -1317,7 +1371,7 @@ jobs:# release job runs on a tag push only, so there is no manual-run bypass.staging-gate:name: staging smoke is green- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))runs-on: ubuntu-latest# Waits up to 30 minutes for the smoke that request-staging-smoke starts.timeout-minutes: 40@@ -1330,7 +1384,7 @@ jobs:env:GH_TOKEN: ${{ github.token }}WAIT_MINUTES: "30"- run: .github/scripts/require_staging_smoke.sh cua-driver "$GITHUB_SHA"+ run: .github/scripts/require_staging_smoke.sh cua-driver "$CERTIFIED_SHA"release:needs:@@ -1348,7 +1402,7 @@ jobs:- e2e-windows- e2e-macos- e2e-standalone-browsers- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')+ if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != ''))runs-on: ubuntu-latest# id-token: keyless Sigstore bundles for every release asset. The# attribution collector reads pull requests and issues.@@ -1362,7 +1416,7 @@ jobs:steps:- name: Refuse to publish unverified or unnotarized artifactsenv:- DO_NOTARIZE: ${{ startsWith(github.ref, 'refs/tags/cua-driver-rs-v') || inputs.notarize == true }}+ DO_NOTARIZE: ${{ ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/cua-driver-rs-v')) || (github.event_name == 'workflow_dispatch' && inputs.rebuild_tag != '')) || inputs.notarize == true }}MACOS_SIGNATURES: ${{ needs.verify-macos-release-signatures.result }}WINDOWS_SIGNATURES: ${{ needs.verify-windows-release-signatures.result }}run: |@@ -1375,7 +1429,7 @@ jobs:- uses: actions/checkout@v4with:fetch-depth: 0- ref: ${{ github.ref }}+ ref: ${{ env.RELEASE_REF }}# Release inputs stay pinned to the tag checkout above; orchestration# helpers run from the workflow revision in a separate checkout.@@ -1389,11 +1443,11 @@ jobs:- name: Determine versionid: versionrun: |- if [[ "$GITHUB_REF" != refs/tags/cua-driver-rs-v* ]]; then- echo "Publication requires a cua-driver-rs-v* tag push, got $GITHUB_REF" >&2+ if [[ "$RELEASE_REF" != refs/tags/cua-driver-rs-v* ]]; then+ echo "Publication requires a cua-driver-rs-v* tag push, got $RELEASE_REF" >&2exit 1fi- VERSION="${GITHUB_REF#refs/tags/cua-driver-rs-v}"+ VERSION="${RELEASE_REF#refs/tags/cua-driver-rs-v}"TAG="cua-driver-rs-v${VERSION}"SHA=$(git rev-parse HEAD)TAG_SHA=$(git rev-list -n 1 "$TAG")@@ -1401,9 +1455,9 @@ jobs:echo "Checked-out source $SHA does not match $TAG ($TAG_SHA)" >&2exit 1fi- # The E2E gates certified github.sha; publish only that exact commit.- if [[ "$SHA" != "$GITHUB_SHA" ]]; then- echo "$TAG ($SHA) is not the E2E-certified commit ($GITHUB_SHA)" >&2+ # The E2E gates certified CERTIFIED_SHA (github.sha or rebuild_sha); publish only that exact commit.+ if [[ "$SHA" != "$CERTIFIED_SHA" ]]; then+ echo "$TAG ($SHA) is not the E2E-certified commit ($CERTIFIED_SHA)" >&2exit 1fiecho "version=$VERSION" >> "$GITHUB_OUTPUT"