Skip to content

feat: github release#1

Merged
rubnogueira merged 11 commits into
mainfrom
feat/github-releases-distribution
May 19, 2026
Merged

feat: github release#1
rubnogueira merged 11 commits into
mainfrom
feat/github-releases-distribution

Conversation

@rubnogueira
Copy link
Copy Markdown

No description provided.

rubnogueira and others added 11 commits January 5, 2025 19:17
Mirrors the refactor just landed in gifsicle-bin, adapted for optipng:

- GH Actions matrix builds optipng from vendor/source/optipng-0.7.8.tar.gz
  on darwin x64/arm64 (x64 cross-built), linux x64/arm64 glibc + musl,
  win32 x64 via MSYS2 mingw (statically linked).
- On version-bump merge to main/master/cjs, the workflow auto-tags
  v<version> and attaches one tarball per matrix variant.
- New lib/install.js downloads the matching tarball via fetch(),
  extracts with system tar, falls back to bin-build source build.
- Dropped bin-wrapper (PruvoNet fork), bin-check, execa, compare-size.
  No more new BinWrapper().src(url, 'darwin', 'arm64').src(...).
- Converted to ESM ("type": "module") for consistency with gifsicle-bin
  and node-expat.
- Engines tightened to >=18.
- Tests rewritten on node:child_process + ava + tempy.

Verified locally: install.js 404s gracefully on the not-yet-existing
v9.2.0 release, falls back to source build, produces a working binary;
ava tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the matching commit in gifsicle-bin:

1. Tests live inside each build matrix job now. Every variant builds
   its optipng binary, copies it to vendor/, and runs ava against that
   exact binary — true per-arch verification, including under Rosetta
   for the cross-built darwin-x64 and inside the alpine container for
   the musl variants whose binaries the glibc host can't load.
2. win32-arm64 added via the windows-11-arm runner + the CLANGARM64
   MSYS2 environment (LLVM/clang targeting ARM64 Windows).
3. Release fires only on push to master. Earlier I had main/master/cjs;
   the user wants the publish flow strictly scoped to master.

Standalone test.yml removed — its job is now done per-arch in build.yml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
In gifsicle-bin, the v7.2.0 PR merged to main and every build job
succeeded — but the release was skipped because the gate was hard-coded
to refs/heads/master while the repo's default branch is main.

Compare github.ref against the actual default_branch so the release
fires on main, master, or whatever the default happens to be.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Conflicts and resolutions:
- lib/index.js: modify/delete. main updated it (arm64 fix), this branch
  deleted it as part of the BinWrapper → lib/install.js refactor.
  Keep the deletion — the file is permanently gone in this design.
- package.json `version`: HEAD 9.2.0 vs main 9.1.1. Keep 9.2.0 (this
  branch is the version bump).

Source install verified locally post-merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
optipng-0.7.8 ships a custom configure shell script — not autotools —
so it does not understand any of the autotools-style flags I borrowed
from the gifsicle/jpegtran workflows:

- darwin-x64 was passing --host=x86_64-apple-darwin and the configure
  bailed with "unknown option: '--host=...'". Drop the --host: Apple
  clang already produces x86_64 binaries from CFLAGS=-arch x86_64, and
  Rosetta 2 (preinstalled on macos-14) runs configure's tiny test
  programs without help.
- win32-x64 / win32-arm64 were passing LDFLAGS as a positional arg
  (`./configure --with-system-zlib LDFLAGS=-static -static-libgcc`),
  which optipng's configure read as a config option and rejected with
  "unknown option: 'LDFLAGS=...'". Move LDFLAGS into the environment
  (`LDFLAGS="..." ./configure ...`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rubnogueira rubnogueira merged commit 7eb6df6 into main May 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant