Skip to content

Commit e9a46d2

Browse files
committed
fix(release): authorize focused beta evidence
1 parent eed27fd commit e9a46d2

8 files changed

Lines changed: 1880 additions & 53 deletions
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Authorized Beta Focused Validation
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
actions: read
8+
attestations: write
9+
contents: read
10+
id-token: write
11+
12+
concurrency:
13+
group: authorized-beta-focused-validation
14+
cancel-in-progress: false
15+
16+
env:
17+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
18+
NODE_VERSION: "24.16.0"
19+
20+
jobs:
21+
validate:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 30
24+
steps:
25+
- name: Validate protected tooling identity
26+
env:
27+
GH_TOKEN: ${{ github.token }}
28+
run: |
29+
set -euo pipefail
30+
if [[ ! "${GITHUB_REF}" =~ ^refs/tags/release-publish/([a-f0-9]{12})-[1-9][0-9]*$ ]]; then
31+
echo "Authorized beta focused validation requires a protected release-publish tag." >&2
32+
exit 1
33+
fi
34+
if [[ "${GITHUB_SHA:0:12}" != "${BASH_REMATCH[1]}" ]]; then
35+
echo "Protected release-publish tag does not match the workflow SHA." >&2
36+
exit 1
37+
fi
38+
tag="${GITHUB_REF#refs/tags/}"
39+
remote_sha="$(
40+
gh api "repos/${GITHUB_REPOSITORY}/git/ref/tags/${tag}" \
41+
--jq '.object | select(.type == "commit") | .sha'
42+
)"
43+
[[ "${remote_sha}" == "${GITHUB_SHA}" ]] || {
44+
echo "Protected release-publish tag moved after dispatch." >&2
45+
exit 1
46+
}
47+
48+
- name: Checkout trusted tooling
49+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
50+
with:
51+
ref: ${{ github.sha }}
52+
fetch-depth: 0
53+
persist-credentials: false
54+
55+
- name: Checkout frozen candidate
56+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
57+
with:
58+
ref: 3fbe94065c2b94f4c08acb6742a69938bf408d94
59+
path: candidate
60+
fetch-depth: 0
61+
persist-credentials: false
62+
63+
- name: Setup Node environment
64+
uses: ./.github/actions/setup-node-env
65+
with:
66+
cache-mode: restore
67+
node-version: ${{ env.NODE_VERSION }}
68+
install-bun: "false"
69+
70+
- name: Build focused evidence
71+
env:
72+
GH_TOKEN: ${{ github.token }}
73+
run: |
74+
set -euo pipefail
75+
mkdir -p "${RUNNER_TEMP}/authorized-beta-focused"
76+
node --import tsx scripts/validate-authorized-beta-focused-evidence.mts create \
77+
--candidate-root candidate \
78+
--output "${RUNNER_TEMP}/authorized-beta-focused/evidence.json" \
79+
--producer-run-id "${GITHUB_RUN_ID}" \
80+
--producer-run-attempt "${GITHUB_RUN_ATTEMPT}" \
81+
--producer-workflow-full-ref "${GITHUB_REF}" \
82+
--producer-workflow-sha "${GITHUB_SHA}"
83+
84+
- name: Attest focused evidence
85+
uses: actions/attest@f7c74d28b9d84cb8768d0b8ca14a4bac6ef463e6 # v4.2.0
86+
with:
87+
subject-path: ${{ runner.temp }}/authorized-beta-focused/evidence.json
88+
89+
- name: Upload focused evidence
90+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
91+
with:
92+
name: authorized-beta-focused-v1-${{ github.run_id }}-${{ github.run_attempt }}
93+
path: ${{ runner.temp }}/authorized-beta-focused/evidence.json
94+
if-no-files-found: error
95+
retention-days: 30

‎.github/workflows/openclaw-npm-release.yml‎

Lines changed: 94 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,22 @@ on:
2929
description: Exact successful Full Release Validation run attempt for this tag/SHA
3030
required: false
3131
type: string
32+
release_evidence_mode:
33+
description: Publication evidence contract
34+
required: true
35+
default: full-release-validation
36+
type: choice
37+
options:
38+
- full-release-validation
39+
- authorized-beta-focused-v1
40+
focused_release_evidence_run_id:
41+
description: Successful Authorized Beta Focused Validation run id
42+
required: false
43+
type: string
44+
focused_release_evidence_run_attempt:
45+
description: Exact Authorized Beta Focused Validation run attempt
46+
required: false
47+
type: string
3248
release_publish_run_id:
3349
description: Approved OpenClaw Release Publish workflow run id
3450
required: false
@@ -874,28 +890,56 @@ jobs:
874890
PREFLIGHT_RUN_ID: ${{ inputs.preflight_run_id }}
875891
FULL_RELEASE_VALIDATION_RUN_ID: ${{ inputs.full_release_validation_run_id }}
876892
FULL_RELEASE_VALIDATION_RUN_ATTEMPT: ${{ inputs.full_release_validation_run_attempt }}
893+
RELEASE_EVIDENCE_MODE: ${{ inputs.release_evidence_mode }}
894+
FOCUSED_RELEASE_EVIDENCE_RUN_ID: ${{ inputs.focused_release_evidence_run_id }}
895+
FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT: ${{ inputs.focused_release_evidence_run_attempt }}
877896
PLUGIN_NPM_RUN_ID: ${{ inputs.plugin_npm_run_id }}
878897
RELEASE_PUBLISH_RUN_ID: ${{ inputs.release_publish_run_id }}
879898
RELEASE_PUBLISH_RUN_ATTEMPT: ${{ inputs.release_publish_run_attempt }}
880899
run: |
881900
set -euo pipefail
901+
RELEASE_EVIDENCE_MODE="${RELEASE_EVIDENCE_MODE:-full-release-validation}"
902+
FOCUSED_RELEASE_EVIDENCE_RUN_ID="${FOCUSED_RELEASE_EVIDENCE_RUN_ID:-}"
903+
FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT="${FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT:-}"
882904
if [[ -z "${PREFLIGHT_RUN_ID}" ]]; then
883905
echo "Real publish requires preflight_run_id from a successful npm preflight run." >&2
884906
exit 1
885907
fi
886-
if [[ -z "${FULL_RELEASE_VALIDATION_RUN_ID}" ]]; then
887-
if [[ -n "${FULL_RELEASE_VALIDATION_RUN_ATTEMPT}" ]]; then
888-
echo "full_release_validation_run_attempt requires full_release_validation_run_id." >&2
908+
if [[ "${RELEASE_EVIDENCE_MODE}" == "authorized-beta-focused-v1" ]]; then
909+
if [[ "${RELEASE_TAG}" != "v2026.8.1-beta.3" || "${RELEASE_NPM_DIST_TAG}" != "beta" ]]; then
910+
echo "authorized-beta-focused-v1 is restricted to v2026.8.1-beta.3 on the beta dist-tag." >&2
889911
exit 1
890912
fi
891-
if [[ "${RELEASE_TAG}" == *"-beta."* && "${RELEASE_NPM_DIST_TAG}" == "beta" ]]; then
892-
echo "::warning::Beta publish is proceeding from npm preflight only; full release validation remains required before stable/latest promotion."
893-
else
894-
echo "Real publish requires full_release_validation_run_id from a successful Full Release Validation run." >&2
913+
if [[ -n "${FULL_RELEASE_VALIDATION_RUN_ID}" || -n "${FULL_RELEASE_VALIDATION_RUN_ATTEMPT}" ]]; then
914+
echo "authorized-beta-focused-v1 must not include full release validation inputs." >&2
915+
exit 1
916+
fi
917+
if [[ -z "${FOCUSED_RELEASE_EVIDENCE_RUN_ID}" || ! "${FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT}" =~ ^[1-9][0-9]*$ ]]; then
918+
echo "authorized-beta-focused-v1 requires the exact focused evidence run id and attempt." >&2
919+
exit 1
920+
fi
921+
elif [[ "${RELEASE_EVIDENCE_MODE}" == "full-release-validation" ]]; then
922+
if [[ -n "${FOCUSED_RELEASE_EVIDENCE_RUN_ID}" || -n "${FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT}" ]]; then
923+
echo "Full release validation evidence mode must not include focused evidence inputs." >&2
924+
exit 1
925+
fi
926+
if [[ -z "${FULL_RELEASE_VALIDATION_RUN_ID}" ]]; then
927+
if [[ -n "${FULL_RELEASE_VALIDATION_RUN_ATTEMPT}" ]]; then
928+
echo "full_release_validation_run_attempt requires full_release_validation_run_id." >&2
929+
exit 1
930+
fi
931+
if [[ "${RELEASE_TAG}" == *"-beta."* && "${RELEASE_NPM_DIST_TAG}" == "beta" ]]; then
932+
echo "::warning::Beta publish is proceeding from npm preflight only; full release validation remains required before stable/latest promotion."
933+
else
934+
echo "Real publish requires full_release_validation_run_id from a successful Full Release Validation run." >&2
935+
exit 1
936+
fi
937+
elif [[ ! "${FULL_RELEASE_VALIDATION_RUN_ATTEMPT}" =~ ^[1-9][0-9]*$ ]]; then
938+
echo "Real publish with full release validation requires a positive full_release_validation_run_attempt." >&2
895939
exit 1
896940
fi
897-
elif [[ ! "${FULL_RELEASE_VALIDATION_RUN_ATTEMPT}" =~ ^[1-9][0-9]*$ ]]; then
898-
echo "Real publish with full release validation requires a positive full_release_validation_run_attempt." >&2
941+
else
942+
echo "Unsupported release_evidence_mode: ${RELEASE_EVIDENCE_MODE}" >&2
899943
exit 1
900944
fi
901945
if [[ "${RELEASE_NPM_DIST_TAG}" == "extended-stable" && -z "${PLUGIN_NPM_RUN_ID// }" ]]; then
@@ -946,6 +990,7 @@ jobs:
946990
environment: npm-release
947991
permissions:
948992
actions: read
993+
attestations: read
949994
contents: read
950995
id-token: write
951996
steps:
@@ -974,7 +1019,7 @@ jobs:
9741019
ref: refs/tags/${{ inputs.tag }}
9751020
# Frozen preflight evidence already binds the exact release SHA and
9761021
# tarball, so real publishes do not need the repository's full history.
977-
fetch-depth: ${{ inputs.preflight_run_id != '' && 1 || 0 }}
1022+
fetch-depth: ${{ inputs.release_evidence_mode == 'authorized-beta-focused-v1' && 0 || (inputs.preflight_run_id != '' && 1 || 0) }}
9781023

9791024
- name: Validate Tideclaw alpha publish target
9801025
if: startsWith(github.ref, 'refs/heads/tideclaw/alpha/')
@@ -1096,7 +1141,7 @@ jobs:
10961141
echo "run_attempt=${preflight_run_attempt}" >> "$GITHUB_OUTPUT"
10971142
10981143
- name: Download full release validation manifest
1099-
if: ${{ inputs.full_release_validation_run_id != '' }}
1144+
if: ${{ inputs.release_evidence_mode == 'full-release-validation' && inputs.full_release_validation_run_id != '' }}
11001145
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
11011146
with:
11021147
name: full-release-validation-${{ inputs.full_release_validation_run_id }}-${{ inputs.full_release_validation_run_attempt }}
@@ -1106,7 +1151,7 @@ jobs:
11061151
github-token: ${{ github.token }}
11071152

11081153
- name: Verify full release validation evidence
1109-
if: ${{ inputs.full_release_validation_run_id != '' }}
1154+
if: ${{ inputs.release_evidence_mode == 'full-release-validation' && inputs.full_release_validation_run_id != '' }}
11101155
env:
11111156
GH_TOKEN: ${{ github.token }}
11121157
FULL_RELEASE_VALIDATION_RUN_ID: ${{ inputs.full_release_validation_run_id }}
@@ -1148,6 +1193,42 @@ jobs:
11481193
--verifier-source-sha "$WORKFLOW_SHA" \
11491194
--verifier-source-file "$STRICT_VALIDATOR_FILE" >/dev/null
11501195
1196+
- name: Download focused release evidence
1197+
if: ${{ inputs.release_evidence_mode == 'authorized-beta-focused-v1' }}
1198+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
1199+
with:
1200+
name: authorized-beta-focused-v1-${{ inputs.focused_release_evidence_run_id }}-${{ inputs.focused_release_evidence_run_attempt }}
1201+
path: authorized-beta-focused-evidence
1202+
repository: ${{ github.repository }}
1203+
run-id: ${{ inputs.focused_release_evidence_run_id }}
1204+
github-token: ${{ github.token }}
1205+
1206+
- name: Verify focused release evidence
1207+
if: ${{ inputs.release_evidence_mode == 'authorized-beta-focused-v1' }}
1208+
env:
1209+
GH_TOKEN: ${{ github.token }}
1210+
FOCUSED_RELEASE_EVIDENCE_RUN_ID: ${{ inputs.focused_release_evidence_run_id }}
1211+
FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT: ${{ inputs.focused_release_evidence_run_attempt }}
1212+
WORKFLOW_FULL_REF: ${{ github.ref }}
1213+
WORKFLOW_SHA: ${{ github.workflow_sha }}
1214+
run: |
1215+
set -euo pipefail
1216+
evidence="authorized-beta-focused-evidence/evidence.json"
1217+
gh attestation verify "${evidence}" \
1218+
--repo "${GITHUB_REPOSITORY}" \
1219+
--signer-workflow "${GITHUB_REPOSITORY}/.github/workflows/authorized-beta-focused-validation.yml" \
1220+
--signer-digest "${WORKFLOW_SHA}" \
1221+
--source-digest "${WORKFLOW_SHA}" \
1222+
--source-ref "${WORKFLOW_FULL_REF}" \
1223+
--deny-self-hosted-runners
1224+
node trusted-workflow/scripts/validate-authorized-beta-focused-evidence.mts verify \
1225+
--candidate-root . \
1226+
--artifact "${evidence}" \
1227+
--producer-run-id "${FOCUSED_RELEASE_EVIDENCE_RUN_ID}" \
1228+
--producer-run-attempt "${FOCUSED_RELEASE_EVIDENCE_RUN_ATTEMPT}" \
1229+
--producer-workflow-full-ref "${WORKFLOW_FULL_REF}" \
1230+
--producer-workflow-sha "${WORKFLOW_SHA}"
1231+
11511232
- name: Verify plugin npm release run metadata
11521233
if: ${{ inputs.npm_dist_tag == 'extended-stable' }}
11531234
env:
@@ -1382,7 +1463,7 @@ jobs:
13821463
echo "tarball_path=$ARTIFACT_TARBALL_PATH" >> "$GITHUB_OUTPUT"
13831464
13841465
- name: Verify full release validation target
1385-
if: ${{ inputs.full_release_validation_run_id != '' }}
1466+
if: ${{ inputs.release_evidence_mode == 'full-release-validation' && inputs.full_release_validation_run_id != '' }}
13861467
env:
13871468
RELEASE_TAG: ${{ inputs.tag }}
13881469
RELEASE_NPM_DIST_TAG: ${{ inputs.npm_dist_tag }}

0 commit comments

Comments
 (0)