diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index ff2c09f6a7f..edaea6bc7f1 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -12,6 +12,11 @@ on: required: true default: true type: boolean + public_release_branch: + description: Public branch that contains the release tag commit, usually main or release/YYYY.M.D + required: false + default: main + type: string concurrency: group: macos-release-${{ inputs.tag }} @@ -66,13 +71,17 @@ jobs: - name: Validate release tag and package metadata env: RELEASE_TAG: ${{ inputs.tag }} - WORKFLOW_REF_NAME: ${{ github.ref_name }} + PUBLIC_RELEASE_BRANCH: ${{ inputs.public_release_branch }} run: | set -euo pipefail + if [[ "${PUBLIC_RELEASE_BRANCH}" != "main" && ! "${PUBLIC_RELEASE_BRANCH}" =~ ^release/[0-9]{4}\.[1-9][0-9]*\.[1-9][0-9]*$ ]]; then + echo "public_release_branch must be main or release/YYYY.M.D, got ${PUBLIC_RELEASE_BRANCH}." >&2 + exit 1 + fi RELEASE_SHA=$(git rev-parse HEAD) - RELEASE_MAIN_REF="refs/remotes/origin/${WORKFLOW_REF_NAME}" + RELEASE_MAIN_REF="refs/remotes/origin/${PUBLIC_RELEASE_BRANCH}" export RELEASE_SHA RELEASE_TAG RELEASE_MAIN_REF - git fetch --no-tags origin "+refs/heads/${WORKFLOW_REF_NAME}:refs/remotes/origin/${WORKFLOW_REF_NAME}" + git fetch --no-tags origin "+refs/heads/${PUBLIC_RELEASE_BRANCH}:refs/remotes/origin/${PUBLIC_RELEASE_BRANCH}" pnpm release:openclaw:npm:check - name: Summarize next step diff --git a/docs/reference/RELEASING.md b/docs/reference/RELEASING.md index f876f172c29..4fba316f3c8 100644 --- a/docs/reference/RELEASING.md +++ b/docs/reference/RELEASING.md @@ -194,7 +194,9 @@ Validation` or from the `main`/release workflow ref so workflow logic and `openclaw/releases-private/.github/workflows/openclaw-npm-dist-tags.yml` for security, because `npm dist-tag add` still needs `NPM_TOKEN` while the public repo keeps OIDC-only publish - - public `macOS Release` is validation-only + - public `macOS Release` is validation-only; when a tag lives only on a + release branch but the workflow is dispatched from `main`, set + `public_release_branch=release/YYYY.M.D` - real private mac publish must pass successful private mac `preflight_run_id` and `validate_run_id` - the real publish paths promote prepared artifacts instead of rebuilding