KAN-58: Fix macOS release runner selection #155

Merged
Twyco merged 1 commits from fix/KAN-58-macos-runner-selection into main 2026-09-27 09:30:32 +00:00
2 changed files with 16 additions and 7 deletions
Showing only changes of commit 52304c7eb2 - Show all commits
+3 -3
View File
@@ -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 }}
+13 -4
View File
@@ -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({