Skip to content

Commit

Permalink
Do not recompute checksums before release if already computed
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Aug 15, 2024
1 parent 736c398 commit 8088710
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ defmodule XLA.MixProject do

def aliases do
[
# When compiling the checksum task, code paths are pruned, so we
# explicitly load hex back
"hex.publish": ["xla.checksum", fn _ -> Mix.ensure_application!(:hex) end, "hex.publish"]
"hex.publish": [&ensure_checksum_file/1, "hex.publish"]
]
end

defp ensure_checksum_file(_) do
valid? =
case File.read("checksum.txt") do
{:ok, content} -> content =~ @version
{:error, :enoent} -> false
end

if not valid? do
raise "run mix xla.checksum before releasing"
end
end

defp deps do
[
{:elixir_make, "~> 0.4", runtime: false},
Expand Down

0 comments on commit 8088710

Please sign in to comment.