Skip to content

Commit

Permalink
contrib(publish): fix shasum generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Oct 20, 2020
1 parent ee87aff commit 39e1169
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions contrib/inertia-publish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package main
import (
"bytes"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"io/ioutil"
"os"
Expand Down Expand Up @@ -52,7 +52,7 @@ func generateSums(buildDir string) map[string]string {
}
sum := sha256.Sum256(data)
build := strings.Join(parts[len(parts)-2:], ".")
sums[build] = base64.URLEncoding.EncodeToString(sum[:])
sums[build] = hex.EncodeToString(sum[:])
return nil
}); err != nil {
out.Fatal(err)
Expand Down
24 changes: 21 additions & 3 deletions contrib/inertia-publish/templates/compiled.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions contrib/inertia-publish/templates/homebrew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Inertia < Formula
# Stable
version "{{ .Version }}"
sha256 "{{ index .Sha256 "darwin.amd64" }}"
url "https://github.com/ubclaunchpad/inertia/releases/download/v#{version}/inertia.v#{version}.darwin.amd64"
url "https://github.com/ubclaunchpad/inertia/releases/download/#{version}/inertia.#{version}.darwin.amd64"

# Build from latest commit
head "https://github.com/ubclaunchpad/inertia.git"
Expand All @@ -20,7 +20,7 @@ def install
system "go", "mod", "download"
system "go", "build", "-o", "#{bin}/inertia"
else
mv "inertia.v#{version}.darwin.amd64", "inertia"
mv "inertia.#{version}.darwin.amd64", "inertia"
bin.install "inertia"
end
end
Expand Down

0 comments on commit 39e1169

Please sign in to comment.