Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ default `aot`) through `config/config.exs` and stash the atom as

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

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

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

The `hex.publish` alias runs `mix emily.checksums` first: it downloads
each tarball from the (now-public) release, records its SHA256 into
`mix emily.publish` runs `mix emily.checksums` first: it downloads each
tarball from the (now-public) release, records its SHA256 into
`native_checksums.txt`, and `mix hex.publish` then packages that file.
(Use `mix emily.publish`, not a plain `mix hex.publish` — the latter
skips the regen, though it fails closed since `hex.build` errors on the
missing checksums file.)
So the consumer verifies downloads against a trust root that lives in
the immutable Hex package, not the mutable GitHub release — with no file
to maintain and nothing to commit. The file is git-ignored and
Expand Down
20 changes: 11 additions & 9 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defmodule Emily.MixProject do
end

def cli do
[preferred_envs: [docs: :docs, "hex.publish": :docs, precommit: :test]]
[preferred_envs: [docs: :docs, "hex.publish": :docs, "emily.publish": :docs, precommit: :test]]
end

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

Expand Down