Commit b8ba479
fix(release): restore release binaries — immutable-release draft flow + portable BSD sed (#641)
## Problem
`v0.2.0` shipped **source-only** (regression from `v0.1.1`, which had
`affinescript-linux-x64`, `affinescript-macos-x64`,
`affinescript-macos-arm64`, `SHA256SUMS`). Downstream consumers on
locked-down networks rely on the prebuilt binary (building from source
needs opam + ~15 packages, blocked when `opam.ocaml.org` 403s), and the
`v0.1.1` binary can't parse `v0.2.0`-only syntax — e.g. quandledb's
`quandle_gui.affine` → `Parse error` (quandledb PR #60 had to pin
`v0.1.1`).
## Root cause — two bugs, both confirmed from the failed v0.2.0 run
([26694097435](https://github.com/hyperpolymath/affinescript/actions/runs/26694097435))
1. **Immutable releases.** `prepare` created a *published* release, then
the build matrix uploaded assets to it. The repo enabled immutable
releases between `v0.1.1` (`immutable:false`) and `v0.2.0`
(`immutable:true`); immutable *published* releases reject asset uploads
— the linux leg died with:
```
HTTP 422: Cannot upload assets to an immutable release.
```
2. **BSD sed.** The version-bake step (added in v0.2.0) used `sed -i
"s/…"`, which **BSD sed on the macOS runners** rejects (`sed: 1:
"lib/version.ml": extra characters at the end of l command`) — so
`macos-x64` and `macos-arm64` failed *before building anything*.
## Fix (`.github/workflows/release.yml` only)
- **Draft → upload → publish:** create the release as a `--draft`
(mutable), let the build legs upload binaries into it, and `gh release
edit --draft=false --latest` **last** in the checksums job — so it seals
atomically with all four assets attached, compatible with immutable
releases.
- **Portable in-place sed:** `sed -i.bak …` (accepted by both GNU and
BSD sed) + remove the backups.
## Verification
- Compiler builds in release mode locally (`dune build --release` → ELF
x86-64); `--version` and `check <file>` work.
- Bake substitutions match `lib/version.ml` (`let value = "0.2.1"`) and
`.build/dune-project` (`(version 0.2.1)`).
- YAML validated.
## Publishing
`v0.2.0` is immutable and cannot be amended, so binaries are published
via a fresh **`v0.2.1`** tag built with this fixed workflow (per the
task: "otherwise cut v0.2.1"). This PR lands the same fix on `main` for
all future releases.
Refs ADR-019, #260 S2.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Lz7pRcec2Z3tVtaAhvB3M8
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Lz7pRcec2Z3tVtaAhvB3M8)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5a42e6e commit b8ba479
1 file changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | | - | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
79 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
0 commit comments