Skip to content
This repository was archived by the owner on Aug 8, 2021. It is now read-only.

Commit 454f707

Browse files
committed
Add additionla step to build, that creates the homebrew file.
1 parent ab9bdb2 commit 454f707

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

cordless.rb_template

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class Cordless < Formula
2+
desc "Discord, but in 1984"
3+
homepage "https://github.com/Bios-Marcel/cordless"
4+
url "https://github.com/Bios-Marcel/cordless/archive/$RELEASE_DATE.tar.gz"
5+
version "$RELEASE_DATE"
6+
sha256 "$TAR_HASH"
7+
head "https://github.com/Bios-Marcel/cordless.git"
8+
9+
depends_on "go" => :build
10+
depends_on "pngpaste" => :recommended
11+
12+
def install
13+
ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache"
14+
(buildpath/"src/github.com/Bios-Marcel/cordless").install buildpath.children
15+
cd "src/github.com/Bios-Marcel/cordless" do
16+
system "go", "build", "-o", bin/"cordless"
17+
prefix.install_metafiles
18+
end
19+
end
20+
21+
test do
22+
system "true"
23+
end
24+
end
25+

release.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,22 @@ else
128128
hub release create -a "$BIN_LINUX" -a "$BIN_DARWIN" -a "$BIN_WINDOWS" -m "${RELEASE_DATE}" -m "${RELEASE_BODY}" "$RELEASE_DATE"
129129
fi
130130

131+
#
132+
# Substitutes the manifest template for the homebrew package. We need to
133+
# download the latets tarball in order to get its sha256 sum.
134+
#
135+
136+
rm cordless.rb
137+
wget https://github.com/Bios-Marcel/cordless/archive/$RELEASE_DATE.tar.gz
138+
TAR_HASH="$(sha256sum ./$RELEASE_DATE.tar.gz | cut -f 1 -d " ")"
139+
export TAR_HASH
140+
rm ./$RELEASE_DATE.tar.gz
141+
envsubst < cordless.rb_template > cordless.rb
131142

132143
#
133144
# Unsetting(and unexporting) previously exported environment variables.
134145
#
135146

136147
unset RELEASE_DATE
137-
unset EXE_HASH
148+
unset EXE_HASH
149+
unset TAR_HASH

0 commit comments

Comments
 (0)