Skip to content

Commit f52ce29

Browse files
igorcostaAutohand Evolve
andcommitted
Verify macOS release artifacts on native architectures
Run Intel builds and transported artifact checks on GitHub's Intel runner so x64 smoke tests do not depend on Rosetta startup timing. Co-authored-by: Autohand Evolve <code-noreply@autohand.ai>
1 parent a2b7e84 commit f52ce29

3 files changed

Lines changed: 32 additions & 11 deletions

File tree

‎.github/workflows/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ This directory contains automated CI/CD workflows for the Autohand CLI project.
2424
- Linux ARM64 (`autohand-linux-arm64`)
2525
- Windows x64 (`autohand-windows-x64.exe`)
2626

27-
4. **Signs macOS binaries after Bun compilation** and verifies the transported
28-
Actions artifacts on macOS before release publication
27+
4. **Signs macOS binaries after Bun compilation** and verifies each transported
28+
Actions artifact on a native Apple Silicon or Intel runner before release
29+
publication
2930

3031
5. **Generates release notes** from the correct previous release tag
3132

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ jobs:
194194
- os: macos-latest
195195
target: darwin-arm64
196196
artifact: autohand-macos-arm64
197-
- os: macos-latest
197+
- os: macos-15-intel
198198
target: darwin-x64
199199
artifact: autohand-macos-x64
200200
- os: ubuntu-latest
@@ -302,12 +302,14 @@ jobs:
302302
verify-macos-artifacts:
303303
needs: [prepare, build]
304304
if: needs.prepare.outputs.should_release == 'true'
305-
runs-on: macos-latest
305+
runs-on: ${{ matrix.os }}
306306
strategy:
307307
matrix:
308-
artifact:
309-
- autohand-macos-arm64
310-
- autohand-macos-x64
308+
include:
309+
- os: macos-latest
310+
artifact: autohand-macos-arm64
311+
- os: macos-15-intel
312+
artifact: autohand-macos-x64
311313

312314
steps:
313315
- name: Download macOS artifact

‎tests/ci/releaseWorkflow.test.ts‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ interface WorkflowJob {
2525
strategy?: {
2626
matrix?: {
2727
artifact?: string[];
28+
include?: Array<{
29+
os: string;
30+
target?: string;
31+
artifact: string;
32+
}>;
2833
};
2934
};
3035
steps: WorkflowStep[];
@@ -149,6 +154,7 @@ describe('release workflow', () => {
149154
it('signs macOS binaries after compilation and verifies transported artifacts before release', () => {
150155
const workflow = loadReleaseWorkflow();
151156
const buildSteps = workflow.jobs.build.steps;
157+
const buildTargets = workflow.jobs.build.strategy?.matrix?.include;
152158
const compileIndex = buildSteps.findIndex((step) => step.name === 'Compile binary');
153159
const signIndex = buildSteps.findIndex((step) => step.name === 'Sign macOS binary');
154160
const smokeIndex = buildSteps.findIndex((step) => step.name === 'Smoke test binary');
@@ -162,6 +168,18 @@ describe('release workflow', () => {
162168
expect(signStep?.if).toBe("runner.os == 'macOS'");
163169
expect(signStep?.run).toContain('codesign --force --sign - --timestamp=none');
164170
expect(signStep?.run).toContain('codesign --verify --strict --verbose=4');
171+
expect(buildTargets).toEqual(expect.arrayContaining([
172+
{
173+
os: 'macos-latest',
174+
target: 'darwin-arm64',
175+
artifact: 'autohand-macos-arm64',
176+
},
177+
{
178+
os: 'macos-15-intel',
179+
target: 'darwin-x64',
180+
artifact: 'autohand-macos-x64',
181+
},
182+
]));
165183

166184
const transportJob = workflow.jobs['verify-macos-artifacts'];
167185
const downloadStep = transportJob?.steps.find(
@@ -172,10 +190,10 @@ describe('release workflow', () => {
172190
);
173191

174192
expect(transportJob?.needs).toEqual(['prepare', 'build']);
175-
expect(transportJob?.['runs-on']).toBe('macos-latest');
176-
expect(transportJob?.strategy?.matrix?.artifact).toEqual([
177-
'autohand-macos-arm64',
178-
'autohand-macos-x64',
193+
expect(transportJob?.['runs-on']).toBe('${{ matrix.os }}');
194+
expect(transportJob?.strategy?.matrix?.include).toEqual([
195+
{ os: 'macos-latest', artifact: 'autohand-macos-arm64' },
196+
{ os: 'macos-15-intel', artifact: 'autohand-macos-x64' },
179197
]);
180198
expect(downloadStep?.uses).toBe('actions/download-artifact@v8');
181199
expect(downloadStep?.with).toEqual({

0 commit comments

Comments
 (0)