Repository navigation
Release precompiled NIFs from GitHub with committed checksum file; drop Hex publishing - #2
Merged
Merged
Conversation
The "Publish to Hex.pm" workflow was triggered on `release: published`, which fires the moment a GitHub release is created, in parallel with the NIF build matrix. Its `mix compile` then tried to download the current runner's precompiled NIF from the release and got a 404 because no archive had been uploaded yet (run 39257344886 for v0.1.1). Independently of that race, the workflow never generated checksum-Elixir.ExEthBls.Native.exs. That file is gitignored and is only ever shipped inside the Hex tarball (it is listed in `package.files`), so a package published this way, or a git dependency on the tag, fails to compile with "the precompiled NIF file does not exist in the checksum file". Changes: - release.yml gains a `publish_hex` job that `needs: publish` (the job attaching the archives to the release), so Hex publishing runs only once every archive exists. It calls hex.yml as a reusable workflow. - hex.yml is now `workflow_call` + `workflow_dispatch` only (the `release:` and `workflow_run:` triggers are gone; the latter never matched anyway because it filtered on branch `main` while the NIF build runs on tags). It checks out the given tag, installs a Rust toolchain, builds the NIF locally in MIX_ENV=test to run the tests and `mix rustler_precompiled.download ExEthBls.Native --all --print`, asserts that the checksum file lists all 20 archives, and then runs `mix hex.publish --yes` in the default env without EX_ETH_BLS_BUILD, so the package is compiled exactly as consumers compile it (NIF downloaded from the release and verified against the checksum file). - README documents the release procedure: push a `vX.Y.Z` tag and let CI create the release and publish; never create the release by hand. - Quote `$GITHUB_ENV` in release.yml (shellcheck SC2086 via actionlint). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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.
Problem
The GitHub release was created manually.
hex.ymlwas triggered onrelease: [published, released], so it started in parallel with the NIF build matrix and itsmix compilegot HTTP 404 downloading an archive that was not attached yet (run 39257344886). Independently, the workflow never generatedchecksum-Elixir.ExEthBls.Native.exs, which is gitignored and only shipped in the Hex tarball, so consumers failed withthe precompiled NIF file does not exist in the checksum file.Changes
release.yml: newpublish_hexjob withneeds: publish, gated on tag refs, callinghex.ymlas a reusable workflow.hex.yml:workflow_call+workflow_dispatch(requiredtaginput) only; checks out the tag, installs Rust, builds the NIF locally inMIX_ENV=testto run tests andmix rustler_precompiled.download ExEthBls.Native --all --print, asserts 20 archives in the checksum file, then runsmix hex.publish --yeswithoutEX_ETH_BLS_BUILD.vX.Y.Ztag, let CI create the release and publish).$GITHUB_ENVsoactionlintruns clean.🤖 Generated with Claude Code