This document describes the complete process for releasing a new version of Natch to Hex.pm with precompiled binaries.
- All tests passing locally (
mix test) - All tests passing on GitHub Actions
- CHANGELOG.md updated with new version
- No compiler warnings
Update the version in mix.exs:
@version "0.X.Y"Add a new section for the release:
## [0.X.Y] - YYYY-MM-DD
### Added
- New features...
### Changed
- Changes to existing functionality...
### Fixed
- Bug fixes...# Commit version bump
git add mix.exs CHANGELOG.md
git commit -m "Release v0.X.Y"
# Create annotated tag
git tag -a v0.X.Y -m "Release v0.X.Y"
# Push to GitHub (triggers precompile workflow)
git push origin main --tagsThe .github/workflows/precompile.yml workflow will automatically:
- Build precompiled binaries for 7 platforms
- Upload them to the GitHub Release
- This takes approximately 10-15 minutes
Monitor the workflow at:
https://github.com/Intellection/natch/actions
Expected binaries:
natch-nif-2.17-x86_64-linux-gnu-0.X.Y.tar.gznatch-nif-2.17-aarch64-linux-gnu-0.X.Y.tar.gznatch-nif-2.17-x86_64-apple-darwin-0.X.Y.tar.gznatch-nif-2.17-aarch64-apple-darwin-0.X.Y.tar.gznatch-nif-2.17-armv7l-linux-gnueabihf-0.X.Y.tar.gz(cross-compiled)natch-nif-2.17-i686-linux-gnu-0.X.Y.tar.gz(cross-compiled)natch-nif-2.17-riscv64-linux-gnu-0.X.Y.tar.gz(cross-compiled)
Once GitHub Actions completes:
# Generate checksums for all precompiled binaries
MIX_ENV=prod mix elixir_make.checksum --all --ignore-unavailableThis creates checksum.exs in your working directory with SHA256 hashes of all binaries.
Important:
- This file is in
.gitignore(don't commit it) - This file is in
mix.exspackagefiles:list (will be included in Hex package)
# Build the package
mix hex.build
# Verify checksum.exs is included
tar -tzf natch-0.X.Y.tar | grep checksum
# Should see: checksum.exs# Publish (will include checksum.exs)
mix hex.publishFollow the prompts and confirm the publication.
Create a test project to verify:
mkdir /tmp/natch-verify && cd /tmp/natch-verify
mix new . --app test_natchAdd to mix.exs:
{:natch, "~> 0.X.Y"}Test installation:
mix deps.get
# Look for: "Downloading precompiled NIF to ..."
# Should NOT see CMake/compiler outputTest functionality:
# With ClickHouse running on localhost:9000
iex -S mix
iex> {:ok, conn} = Natch.start_link(host: "localhost", port: 9000)
iex> Natch.execute(conn, "SELECT 1")- Ensure GitHub Actions completed successfully
- Check the v0.X.Y release has all 7 binaries
- Try deleting local cache:
rm -rf ~/.cache/elixir_make/ - Re-run:
MIX_ENV=prod mix elixir_make.checksum --all
- Verify checksum.exs is in the Hex package:
mix hex.buildand inspect - Check GitHub release has public access to binaries
- Verify the URL template in mix.exs matches:
https://github.com/Intellection/natch/releases/download/v#{@version}/@{artefact_filename}
- Cross-compiled platforms (armv7l, i686, riscv64) are best-effort
- Users on those platforms will fall back to source compilation
- This is expected and acceptable
-
Announce on:
- Elixir Forum
- GitHub Discussions
- Social media (optional)
-
Monitor for issues:
- https://github.com/Intellection/natch/issues
- Hex.pm package page
-
Clean up local artifacts:
rm checksum.exs
# Full release in one go (after version updates committed)
git tag -a v0.X.Y -m "Release v0.X.Y"
git push origin main --tags
# Wait ~10-15 min for GitHub Actions...
MIX_ENV=prod mix elixir_make.checksum --all --ignore-unavailable
mix hex.build # verify
mix hex.publish
# Clean up
rm checksum.exs- Patch (0.X.Y): Bug fixes, documentation, minor improvements
- Minor (0.X.0): New features, new types, API additions (backward compatible)
- Major (X.0.0): Breaking changes, API redesign
Current: v0.2.0 - First public release with precompiled binaries