feat: github release#1
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.