Commit 46ea89b
authored
fix(publish): drop macos-13, cross-build darwin-x64 on macos-latest (v0.2.2) (#25)
## Why
GitHub's `macos-13` (Intel) runner pool is being phased out — allocation
queue routinely sits at 1–4+ hours during peak load. The `v0.2.1`
publish run from #24 was held there indefinitely and had to be
cancelled, so `0.2.1` never reached the Marketplace despite the rest of
the matrix succeeding cleanly.
## What
`vsce package --target X` only stamps the .vsix manifest with the target
name — the .vsix's actual native `.node` bindings are whatever happens
to be in `node_modules` at package time. So `darwin-x64` doesn't need an
Intel runner: we can install darwin-x64 optional bindings on
`macos-latest` (M-series, arm64) via pnpm's `supportedArchitectures`
filter and then package as `--target darwin-x64`.
The build step (`pnpm build` runs `tsdown` which uses rolldown) still
needs a runnable native binding for the host arch, so the workflow now
installs twice:
1. `pnpm install --frozen-lockfile` — default `supportedArchitectures`
matches the host; `pnpm build` runs against host bindings.
2. `pnpm install --frozen-lockfile
--config.supportedArchitectures.cpu=${{ matrix.pkg_cpu }}` — swaps
`node_modules` to carry the target arch's bindings before `vsce
package`.
For host==target entries (`win32-x64` on windows, `linux-x64` on ubuntu,
`darwin-arm64` on macos-latest) the second install is effectively a
no-op. For `darwin-x64` on macos-latest it prunes the arm64 bindings and
installs x64 ones, producing a .vsix Intel Mac users can actually run.
## Matrix change
| Target | Old runner | New runner |
|---|---|---|
| win32-x64 | windows-latest | windows-latest *(unchanged)* |
| linux-x64 | ubuntu-latest | ubuntu-latest *(unchanged)* |
| darwin-x64 | **macos-13 (Intel)** | **macos-latest (cross-install x64
bindings)** |
| darwin-arm64 | macos-latest | macos-latest *(unchanged)* |
Same four targets ship. Allocation latency is gone.
## Version
Bumped to `0.2.2`. CHANGELOG notes that `0.2.1` was tagged but never
reached the Marketplace — `0.2.2` is the first version that actually
completes the platform-specific publish flow introduced in `0.2.1`.
## Test plan
- [x] YAML parses; matrix expands to 4 entries with `pkg_cpu` keys
- [ ] Workflow dry-run via `gh workflow run publish.yml --ref
fix/cross-build-darwin-x64 -f dry_run=true` — should complete in ~10–15
min total instead of stalling on Intel Mac allocation
- [ ] After merge: real publish completes; verify all four platform
builds appear on Marketplace and Open VSX under `0.2.2`
## Risks
- **`pnpm install --config.supportedArchitectures.cpu=x64` on arm64
macOS** — assumes pnpm prunes the wrong-arch bindings on the second
install. If it instead leaves both arch bindings present, the
darwin-arm64 .vsix would be ~3–5 MB larger than necessary (extra unused
x64 .node files inside) but would still function. Worth verifying on the
dry run.
- **Wrong-arch `.node` files in node_modules** during the second install
shouldn't trigger postinstall scripts because the napi-rs binding
packages are pure data (just `.node` + `package.json`), not executable
installs. If a future native dep adds a postinstall that
platform-checks, this swap would need to be more surgical.
## Stuck runs
I cancelled the two queued runs from #24:
- `25370742474` (push to main, real publish for 0.2.1)
- `25369816967` (workflow_dispatch dry-run on the feature branch)3 files changed
Lines changed: 37 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
| 124 | + | |
115 | 125 | | |
116 | | - | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | 129 | | |
| 130 | + | |
119 | 131 | | |
120 | 132 | | |
121 | 133 | | |
| |||
131 | 143 | | |
132 | 144 | | |
133 | 145 | | |
134 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
135 | 150 | | |
136 | 151 | | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
140 | 164 | | |
141 | 165 | | |
142 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
5 | 15 | | |
6 | 16 | | |
7 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments