|
| 1 | +--- |
| 2 | +name: elixir-hex-release |
| 3 | +description: Run a safe, repeatable Elixir library release flow (changelog, version bump, tag, GitHub release, Hex publish), including preflight checks and Hex package-name ownership validation. |
| 4 | +--- |
| 5 | + |
| 6 | +# Elixir Hex Release |
| 7 | + |
| 8 | +## When to use |
| 9 | +- Releasing this repository as a new Hex version. |
| 10 | +- User asks to "cut a release", "publish to hex", or "bump version + tag + release". |
| 11 | + |
| 12 | +## Preflight (must pass first) |
| 13 | +1. Confirm clean working tree: |
| 14 | + ```bash |
| 15 | + git status --short --branch |
| 16 | + ``` |
| 17 | +2. Run required project quality checks: |
| 18 | + ```bash |
| 19 | + mix format |
| 20 | + mix test |
| 21 | + mix credo --strict |
| 22 | + ``` |
| 23 | +3. Confirm intended release version (example: `0.1.1`). |
| 24 | +4. Validate Hex package target and ownership: |
| 25 | + ```bash |
| 26 | + mix hex.info moqx |
| 27 | + # if authenticated: |
| 28 | + mix hex.owner list moqx |
| 29 | + ``` |
| 30 | + - If package name already exists and you are not an owner, stop and choose a different package name in `mix.exs` (`package: [name: "..."]`). |
| 31 | + |
| 32 | +## Release workflow |
| 33 | +1. Update `CHANGELOG.md` with a new version section and release date. |
| 34 | +2. Bump `version` in `mix.exs`. |
| 35 | +3. If README install snippet includes pinned version, update it. |
| 36 | +4. Commit: |
| 37 | + ```bash |
| 38 | + git add CHANGELOG.md mix.exs README.md |
| 39 | + git commit -m "release: vX.Y.Z" |
| 40 | + git push |
| 41 | + ``` |
| 42 | +5. Create and push annotated tag: |
| 43 | + ```bash |
| 44 | + git tag -a vX.Y.Z -m "vX.Y.Z" |
| 45 | + git push origin vX.Y.Z |
| 46 | + ``` |
| 47 | +6. Publish to Hex (required): |
| 48 | + ```bash |
| 49 | + mix hex.publish |
| 50 | + ``` |
| 51 | + - For first release of a package, this step is the authoritative publication. |
| 52 | +7. Publish docs (recommended): |
| 53 | + ```bash |
| 54 | + mix hex.docs |
| 55 | + ``` |
| 56 | +8. Create GitHub release (optional): |
| 57 | + ```bash |
| 58 | + gh release create vX.Y.Z --title "<project> vX.Y.Z" --notes-file /tmp/release-notes.md |
| 59 | + ``` |
| 60 | + |
| 61 | +## Notes for this repo |
| 62 | +- Required before committing: `mix format`, `mix test`, `mix credo`. |
| 63 | +- Existing tag/release operations may happen independently, but Hex publication is the critical ship step. |
| 64 | +- Keep release notes aligned with `CHANGELOG.md`. |
| 65 | + |
| 66 | +## Quick operator checklist |
| 67 | +- [ ] Preflight checks pass |
| 68 | +- [ ] Changelog updated |
| 69 | +- [ ] `mix.exs` version bumped |
| 70 | +- [ ] Commit pushed |
| 71 | +- [ ] Tag created and pushed |
| 72 | +- [ ] `mix hex.publish` completed |
| 73 | +- [ ] `mix hex.docs` completed (recommended) |
| 74 | +- [ ] GitHub release created/published (optional) |
0 commit comments