Skip to content

Commit 48b4171

Browse files
authored
Merge pull request #138 from ausimian/fix/hex-publish-alias
fix(release): rename broken hex.publish alias to emily.publish
2 parents 121b68c + 7b60dc9 commit 48b4171

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

MAINTAINING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ default `aot`) through `config/config.exs` and stash the atom as
5151

5252
Consumers verify each NIF tarball against the checksum pinned in
5353
`native_checksums.txt`, which ships in the hex package. The
54-
`hex.publish` alias regenerates that file from the freshly-built
55-
release artifacts on every publish (step 4), so there is nothing to
54+
`mix emily.publish` alias regenerates that file from the freshly-built
55+
release artifacts before publishing (step 4), so there is nothing to
5656
update or commit by hand — the file is git-ignored and can't go stale.
5757

5858
### 1. Land changes on `main`
@@ -116,12 +116,15 @@ Promote the release so its assets are public, then publish:
116116

117117
```sh
118118
gh release edit <v> --repo ausimian/emily --draft=false # assets go public
119-
mix hex.publish # alias pins checksums, then publishes
119+
mix emily.publish # regenerate checksums, then publish
120120
```
121121

122-
The `hex.publish` alias runs `mix emily.checksums` first: it downloads
123-
each tarball from the (now-public) release, records its SHA256 into
122+
`mix emily.publish` runs `mix emily.checksums` first: it downloads each
123+
tarball from the (now-public) release, records its SHA256 into
124124
`native_checksums.txt`, and `mix hex.publish` then packages that file.
125+
(Use `mix emily.publish`, not a plain `mix hex.publish` — the latter
126+
skips the regen, though it fails closed since `hex.build` errors on the
127+
missing checksums file.)
125128
So the consumer verifies downloads against a trust root that lives in
126129
the immutable Hex package, not the mutable GitHub release — with no file
127130
to maintain and nothing to commit. The file is git-ignored and

mix.exs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule Emily.MixProject do
4444
end
4545

4646
def cli do
47-
[preferred_envs: [docs: :docs, "hex.publish": :docs, precommit: :test]]
47+
[preferred_envs: [docs: :docs, "hex.publish": :docs, "emily.publish": :docs, precommit: :test]]
4848
end
4949

5050
def application do
@@ -146,14 +146,16 @@ defmodule Emily.MixProject do
146146
# *deliberately* preserved across `mix clean` (rebuilding from
147147
# source is ~5–7 min). Wipe it explicitly with `mix clean.mlx`.
148148
"clean.mlx": &clean_mlx/1,
149-
# Regenerate the pinned NIF checksums from the freshly-built release
150-
# artifacts on every publish, so `native_checksums.txt` can never go
151-
# stale and there is nothing for the maintainer to remember. The
152-
# repeated `hex.publish` runs the real task — Mix resolves a
153-
# same-named step to the underlying task rather than recursing.
154-
# `emily.checksums` downloads the published artifacts, so this also
155-
# refuses to publish until the release assets are public.
156-
"hex.publish": ["emily.checksums", "hex.publish"]
149+
# `mix emily.publish` regenerates the pinned NIF checksums from the
150+
# freshly-built release artifacts and then publishes, so
151+
# `native_checksums.txt` (git-ignored) is always current with nothing
152+
# to commit by hand. `emily.checksums` downloads the published
153+
# artifacts, so it also refuses to run until the release assets are
154+
# public. A plain `mix hex.publish` skips the regen but fails closed —
155+
# `hex.build` errors on the missing checksums file. (This is a
156+
# distinct task name on purpose: a self-referential `hex.publish`
157+
# alias can't resolve back to the Hex archive task.)
158+
"emily.publish": ["emily.checksums", "hex.publish"]
157159
]
158160
end
159161

0 commit comments

Comments
 (0)