mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
fix(release): restore 258 release-workflow fixes (draft 403, skill suite isolation) (#42343)
* ci: isolate real-process skill release suites Linux and mac skill-sharing release gates hit child-readiness marker timeouts in run 43573545467. The nested Vitest children inherit process.env, and per-file isolation is only on for Windows unless ORCA_VITEST_ISOLATE_EVERY_FILE is set. Reapply the reviewed 258 fix (3ad9722af6) to both skill-suite steps. No suite, assertion or timeout changes. * fix(release): draft from the verified tag with default-branch metadata Run 43573545467 got 403 "Resource not accessible by integration" because the draft POST sent the release commit SHA as target_commitish, which needs workflow authority GITHUB_TOKEN cannot get. The existing tag owns source identity; target_commitish is ignored for an existing tag, so send the default-branch name as API metadata (design B, as ind28d414bbd), with the D1b fixes: - An already-published release, or one published mid-preparation, now fails instead of returning success to downstream builds. - Peel the captured tag object ID (git/tags, git/commits) rather than re-dereferencing the tag name; bind it to the checkout and SOURCE_SHA. - Refuse a draft electron-builder would not select first (untagged, bare-version shadow, other id, published, invisible), the #21835 shape. - Re-read the tag after drafting, export the verified tag object and commit, and re-check both immediately before publish-release undrafts. Uses only the official GITHUB_TOKEN.
This commit is contained in:
@@ -668,6 +668,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
outputs:
|
||||
tag_object: ${{ steps.draft.outputs.tag_object }}
|
||||
release_sha: ${{ steps.draft.outputs.release_sha }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -685,7 +688,9 @@ jobs:
|
||||
config/scripts/release/publication/assert-github-release-is-draft.mjs
|
||||
|
||||
- name: Create draft release with bounded generated notes
|
||||
id: draft
|
||||
env:
|
||||
SOURCE_SHA: ${{ needs.cut.outputs.source_sha }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.cut.outputs.tag }}
|
||||
run: node config/scripts/release/publication/create-draft-release.mjs "$TAG"
|
||||
@@ -2187,6 +2192,7 @@ jobs:
|
||||
publish-release:
|
||||
needs:
|
||||
- cut
|
||||
- create-release
|
||||
- build
|
||||
- build-mac
|
||||
- verify-mac-build
|
||||
@@ -2197,6 +2203,7 @@ jobs:
|
||||
if: >-
|
||||
!cancelled() &&
|
||||
needs.cut.result == 'success' &&
|
||||
needs.create-release.result == 'success' &&
|
||||
needs.build.result == 'success' &&
|
||||
needs.build-mac.result == 'success' &&
|
||||
needs.verify-mac-build.result == 'success' &&
|
||||
@@ -2243,6 +2250,33 @@ jobs:
|
||||
TAG: ${{ needs.cut.outputs.tag }}
|
||||
run: node config/scripts/release/publication/verify-release-required-assets.mjs "$TAG"
|
||||
|
||||
- name: Verify release tag still matches the drafted source
|
||||
# Why: the draft targets default-branch metadata, so undrafting after a moved or deleted tag would publish
|
||||
# these assets under the wrong commit. Fail unless the tag is still the object create-release verified.
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.cut.outputs.tag }}
|
||||
TAG_OBJECT: ${{ needs.create-release.outputs.tag_object }}
|
||||
RELEASE_SHA: ${{ needs.create-release.outputs.release_sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ ! "$TAG_OBJECT" =~ ^[0-9a-f]{40}$ || ! "$RELEASE_SHA" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
echo "::error::create-release did not record the verified tag object and release commit for $TAG."
|
||||
exit 1
|
||||
fi
|
||||
ref_json="$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG")"
|
||||
ref="$(jq -r '.ref' <<<"$ref_json")"
|
||||
object="$(jq -r '.object.sha' <<<"$ref_json")"
|
||||
type="$(jq -r '.object.type' <<<"$ref_json")"
|
||||
commit="$object"
|
||||
if [[ "$type" == "tag" ]]; then
|
||||
commit="$(gh api "repos/$GITHUB_REPOSITORY/git/tags/$object" | jq -r 'select(.object.type == "commit") | .object.sha')"
|
||||
fi
|
||||
if [[ "$ref" != "refs/tags/$TAG" || "$object" != "$TAG_OBJECT" || "$commit" != "$RELEASE_SHA" ]]; then
|
||||
echo "::error::Remote tag $TAG no longer resolves to verified object $TAG_OBJECT (commit $RELEASE_SHA); refusing to publish."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Publish release
|
||||
# Reassert prerelease from tag: on 2026-04-27 builder flipped RC to false/latest and broke release math; builder output is not authoritative.
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user