Skip to content

Release precompiled NIFs from GitHub with committed checksum file; drop Hex publishing - #2

Merged
vbaranov merged 2 commits into
mainfrom
fix-hex-publish-workflow
Oct 19, 2026
Merged

vbaranov merged 2 commits into
mainfrom
fix-hex-publish-workflow

Conversation

@vbaranov

@vbaranov vbaranov commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Note: superseded by the follow-up PR that drops Hex publishing and distributes from GitHub only. This description reflects what this PR merged.

Problem

The GitHub release was created manually. hex.yml was triggered on release: [published, released], so it started in parallel with the NIF build matrix and its mix compile got HTTP 404 downloading an archive that was not attached yet (run 39257344886). Independently, the workflow never generated checksum-Elixir.ExEthBls.Native.exs, which is gitignored and only shipped in the Hex tarball, so consumers failed with the precompiled NIF file does not exist in the checksum file.

Changes

  • release.yml: new publish_hex job with needs: publish, gated on tag refs, calling hex.yml as a reusable workflow.
  • hex.yml: workflow_call + workflow_dispatch (required tag input) only; checks out the tag, installs Rust, builds the NIF locally in MIX_ENV=test to run tests and mix rustler_precompiled.download ExEthBls.Native --all --print, asserts 20 archives in the checksum file, then runs mix hex.publish --yes without EX_ETH_BLS_BUILD.
  • README: release procedure (push a vX.Y.Z tag, let CI create the release and publish).
  • Version bumped to 0.1.2.
  • Quoted $GITHUB_ENV so actionlint runs clean.

🤖 Generated with Claude Code

vbaranov and others added 2 commits October 19, 2026 21:59
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>
@vbaranov
vbaranov merged commit ee3071e into main Oct 19, 2026
2 checks passed
@vbaranov
vbaranov deleted the fix-hex-publish-workflow branch October 19, 2026 19:06
@vbaranov vbaranov changed the title Publish to Hex only after NIF archives are released, with checksum file Release precompiled NIFs from GitHub with committed checksum file; drop Hex publishing Oct 19, 2026
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