Skip to content

Commit 327c7b1

Browse files
committed
ci(release): optional macOS arm64-only (M-series) workflow dispatch
- configure job builds dynamic matrix; dispatch can target Apple Silicon only - skip dual-arch YAML merge when only arm64 artifacts exist - publish GitHub assets with release-assets/* for partial matrices - docs: M-series dispatch + local bun run dist:desktop:dmg:arm64 - marketing download: label M-series / Apple Silicon Made-with: Cursor
1 parent 2654eb6 commit 327c7b1

3 files changed

Lines changed: 70 additions & 40 deletions

File tree

.github/workflows/release.yml

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,49 @@ on:
1010
description: "Release version (for example 1.2.3 or v1.2.3)"
1111
required: true
1212
type: string
13+
mac_arm64_only:
14+
description: "Apple Silicon (M-series) Mac only — build and publish only the macOS arm64 DMG (skip Intel Mac, Linux, Windows). Ignored when releasing via tag push."
15+
required: false
16+
type: boolean
17+
default: false
1318

1419
permissions:
1520
contents: write
1621
id-token: write
1722

1823
jobs:
24+
configure:
25+
name: Configure build matrix
26+
runs-on: ubuntu-24.04
27+
outputs:
28+
matrix: ${{ steps.set.outputs.matrix }}
29+
mac_arm64_only: ${{ steps.set.outputs.mac_arm64_only }}
30+
steps:
31+
- id: set
32+
name: Select desktop targets
33+
shell: bash
34+
run: |
35+
set -euo pipefail
36+
mac_arm64_only="false"
37+
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
38+
input="${{ github.event.inputs.mac_arm64_only }}"
39+
if [[ "$input" == "true" ]]; then
40+
mac_arm64_only="true"
41+
fi
42+
fi
43+
echo "mac_arm64_only=$mac_arm64_only" >> "$GITHUB_OUTPUT"
44+
45+
if [[ "$mac_arm64_only" == "true" ]]; then
46+
matrix_json='[{"label":"macOS arm64","runner":"macos-14","platform":"mac","target":"dmg","arch":"arm64"}]'
47+
else
48+
matrix_json='[{"label":"macOS arm64","runner":"macos-14","platform":"mac","target":"dmg","arch":"arm64"},{"label":"macOS x64","runner":"macos-15-intel","platform":"mac","target":"dmg","arch":"x64"},{"label":"Linux x64","runner":"ubuntu-24.04","platform":"linux","target":"AppImage","arch":"x64"},{"label":"Windows x64","runner":"windows-2022","platform":"win","target":"nsis","arch":"x64"}]'
49+
fi
50+
{
51+
echo "matrix<<MATRIX_JSON_EOF"
52+
echo "$matrix_json"
53+
echo "MATRIX_JSON_EOF"
54+
} >> "$GITHUB_OUTPUT"
55+
1956
preflight:
2057
name: Preflight
2158
runs-on: ubuntu-24.04
@@ -79,32 +116,12 @@ jobs:
79116

80117
build:
81118
name: Build ${{ matrix.label }}
82-
needs: preflight
119+
needs: [preflight, configure]
83120
runs-on: ${{ matrix.runner }}
84121
strategy:
85122
fail-fast: false
86123
matrix:
87-
include:
88-
- label: macOS arm64
89-
runner: macos-14
90-
platform: mac
91-
target: dmg
92-
arch: arm64
93-
- label: macOS x64
94-
runner: macos-15-intel
95-
platform: mac
96-
target: dmg
97-
arch: x64
98-
- label: Linux x64
99-
runner: ubuntu-24.04
100-
platform: linux
101-
target: AppImage
102-
arch: x64
103-
- label: Windows x64
104-
runner: windows-2022
105-
platform: win
106-
target: nsis
107-
arch: x64
124+
include: ${{ fromJson(needs.configure.outputs.matrix) }}
108125
steps:
109126
- name: Checkout
110127
uses: actions/checkout@v6
@@ -258,7 +275,7 @@ jobs:
258275

259276
release:
260277
name: Publish GitHub Release
261-
needs: [preflight, build, publish_cli]
278+
needs: [preflight, build, publish_cli, configure]
262279
runs-on: ubuntu-24.04
263280
steps:
264281
- name: Checkout
@@ -280,10 +297,17 @@ jobs:
280297

281298
- name: Merge macOS updater manifests
282299
run: |
283-
node scripts/merge-mac-update-manifests.ts \
284-
release-assets/latest-mac.yml \
285-
release-assets/latest-mac-x64.yml
286-
rm -f release-assets/latest-mac-x64.yml
300+
set -euo pipefail
301+
if [[ "${{ needs.configure.outputs.mac_arm64_only }}" == "true" ]]; then
302+
echo "macOS arm64-only build: using latest-mac.yml from the arm64 builder as-is."
303+
elif [[ -f release-assets/latest-mac-x64.yml ]]; then
304+
node scripts/merge-mac-update-manifests.ts \
305+
release-assets/latest-mac.yml \
306+
release-assets/latest-mac-x64.yml
307+
rm -f release-assets/latest-mac-x64.yml
308+
else
309+
echo "No latest-mac-x64.yml present; using latest-mac.yml as-is."
310+
fi
287311
288312
- name: Stage documentation for release assets
289313
env:
@@ -314,16 +338,7 @@ jobs:
314338
generate_release_notes: true
315339
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
316340
make_latest: ${{ needs.preflight.outputs.make_latest }}
317-
files: |
318-
release-assets/*.dmg
319-
release-assets/*.zip
320-
release-assets/*.AppImage
321-
release-assets/*.exe
322-
release-assets/*.blockmap
323-
release-assets/latest*.yml
324-
release-assets/okcode-CHANGELOG.md
325-
release-assets/okcode-RELEASE-NOTES.md
326-
release-assets/okcode-ASSETS-MANIFEST.md
341+
files: release-assets/*
327342
fail_on_unmatched_files: true
328343

329344
finalize:

apps/marketing/src/pages/download.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Layout from "../layouts/Layout.astro";
1818
</div>
1919
<div class="download-cards">
2020
<a class="download-card" data-asset="arm64.dmg" href="#">
21-
<span class="card-arch">Apple Silicon (arm64)</span>
21+
<span class="card-arch">M-series / Apple Silicon (arm64)</span>
2222
<span class="card-format">.dmg</span>
2323
</a>
2424
<a class="download-card" data-asset="x64.dmg" href="#">

docs/release.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,22 @@ Checklist:
127127
6. Add Azure secrets listed above in GitHub Actions secrets.
128128
7. Re-run a tag release and confirm Windows installer is signed.
129129

130-
## 4) Ongoing release checklist
130+
## 4) Apple Silicon (M-series) Mac–only release (manual dispatch)
131+
132+
To ship **only** the macOS **arm64** DMG (M-series / Apple Silicon) and skip Intel Mac, Linux, and Windows builds:
133+
134+
1. Open **Actions → Release Desktop → Run workflow**.
135+
2. Set **version** to the SemVer you are releasing (for example `0.0.2` or `v0.0.2`).
136+
3. Enable **mac_arm64_only** (workflow input).
137+
4. Run the workflow.
138+
139+
Tag pushes always build the **full** matrix (all platforms); the M-series-only option applies only to **workflow_dispatch**.
140+
141+
To build the same arm64 DMG locally on an Apple Silicon Mac:
142+
143+
`bun run dist:desktop:dmg:arm64`
144+
145+
## 5) Ongoing release checklist
131146

132147
1. Ensure `main` is green in CI.
133148
2. Bump app version as needed (see `scripts/update-release-package-versions.ts` and [CHANGELOG.md](../CHANGELOG.md) / [docs/releases/](releases/README.md) for notes).
@@ -139,7 +154,7 @@ Checklist:
139154
- release job uploads expected files
140155
6. Smoke test downloaded artifacts.
141156

142-
## 5) Troubleshooting
157+
## 6) Troubleshooting
143158

144159
- macOS build unsigned when expected signed:
145160
- Check all Apple secrets are populated and non-empty.

0 commit comments

Comments
 (0)