From 52304c7eb28674567ead2d6d4dc51cd460817d1c Mon Sep 17 00:00:00 2001 From: Twyco Date: Sun, 27 Sep 2026 11:30:18 +0200 Subject: [PATCH] fix(KAN-58): select macOS runner from repository variable --- .github/workflows/macos-release.yml | 6 +++--- native/tests/macos-workflow.test.js | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 4d0ce99..0af4023 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -37,7 +37,6 @@ jobs: outputs: commit: ${{ steps.ref.outputs.commit }} tag: ${{ steps.ref.outputs.tag }} - runner: ${{ steps.ref.outputs.runner }} steps: - name: Check out repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -64,7 +63,7 @@ jobs: commit="$(git rev-parse --verify "refs/tags/$tag^{commit}")" git merge-base --is-ancestor "$commit" origin/main || { echo 'Release tag must belong to main.' >&2; exit 1; } git checkout --detach "$commit" - printf 'commit=%s\ntag=%s\nrunner=%s\n' "$commit" "$tag" "$MACOS_RUNNER" >> "$GITHUB_OUTPUT" + printf 'commit=%s\ntag=%s\n' "$commit" "$tag" >> "$GITHUB_OUTPUT" - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 @@ -81,7 +80,8 @@ jobs: release: name: Sign, notarize, verify and publish macOS needs: prepare - runs-on: ${{ needs.prepare.outputs.runner }} + # Gitea resolves runner labels before outputs from prepare are available. + runs-on: ${{ vars.MACOS_RUNNER }} timeout-minutes: 120 env: RELEASE_TAG: ${{ needs.prepare.outputs.tag }} diff --git a/native/tests/macos-workflow.test.js b/native/tests/macos-workflow.test.js index 687cdaa..b5964df 100644 --- a/native/tests/macos-workflow.test.js +++ b/native/tests/macos-workflow.test.js @@ -86,13 +86,22 @@ test('release selection succeeds using Git alone without an administrative API t GITHUB_API_URL: 'http://127.0.0.1:1', }); assert.equal(result.status, 0, result.stderr); - assert.equal( - result.output, - `commit=${f.commit}\ntag=macos-v1.2.3\nrunner=macos-local\n`, - ); + assert.equal(result.output, `commit=${f.commit}\ntag=macos-v1.2.3\n`); assert.equal(f.git(f.checkout, 'rev-parse', 'HEAD'), f.commit); }); +test('macOS scheduling uses a repository variable while release steps remain gated by preparation', () => { + const release = workflow.split('\n release:\n')[1]; + const runner = release.match(/^ {4}runs-on: (.+)$/m)?.[1]; + assert.equal(runner, '${{ vars.MACOS_RUNNER }}'); + assert.match(release, /^ {4}needs: prepare$/m); + assert.match(release, /ref: \$\{\{ needs\.prepare\.outputs\.commit \}\}/); + assert.match( + release, + /RELEASE_TAG: \$\{\{ needs\.prepare\.outputs\.tag \}\}/, + ); +}); + test('manual release on main accepts an existing tag without moving it', (t) => { const f = fixture(t); const result = f.run({