Skip to content

Commit 0b5dae2

Browse files
committed
chore: drop brew bottles
1 parent a7f60e3 commit 0b5dae2

File tree

1 file changed

+30
-41
lines changed

1 file changed

+30
-41
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ jobs:
148148
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
149149
run: |
150150
set -euo pipefail
151-
TAR_URL="https://github.com/ruphy/sshdb/archive/refs/tags/v${VERSION}.tar.gz"
152-
SHA256=$(curl -L "$TAR_URL" | shasum -a 256 | awk '{print $1}')
153-
154-
# Calculate checksums for bottle files
151+
# Calculate checksums for per-platform release artifacts
155152
MACOS_X86_64_TAR="artifacts/sshdb-macos-x86_64/sshdb-macos-x86_64.tar.gz"
156153
MACOS_ARM64_TAR="artifacts/sshdb-macos-aarch64/sshdb-macos-aarch64.tar.gz"
157154
LINUX_X86_64_TAR="artifacts/sshdb-linux-x86_64/sshdb-linux-x86_64.tar.gz"
@@ -176,69 +173,61 @@ jobs:
176173
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/ruphy/homebrew-sshdb" "${TAP_DIR}"
177174
mkdir -p "${TAP_DIR}/Formula"
178175
179-
# Generate formula with bottle block
176+
# Generate formula that directly references the prebuilt archives we publish
177+
# rather than bottle artifacts (our release assets already serve as distro-specific binaries).
178+
# This avoids Homebrew looking for bottle filenames that don't exist.
180179
{
181180
cat <<EOFRUBY
182181
class Sshdb < Formula
183182
desc "Keyboard-first SSH library and launcher TUI"
184183
homepage "https://github.com/ruphy/sshdb"
185-
url "${TAR_URL}"
186-
sha256 "${SHA256}"
184+
version "${VERSION}"
187185
license "GPL-3.0-or-later"
188-
depends_on "rust" => :build
189186
EOFRUBY
190187
191-
if [ -n "${MACOS_X86_64_SHA}" ] || [ -n "${MACOS_ARM64_SHA}" ] || [ -n "${LINUX_X86_64_SHA}" ]; then
188+
if [ -n "${MACOS_ARM64_SHA}" ] || [ -n "${MACOS_X86_64_SHA}" ]; then
192189
cat <<EOFRUBY
193-
bottle do
194-
root_url "https://github.com/ruphy/sshdb/releases/download/v${VERSION}"
190+
191+
on_macos do
195192
EOFRUBY
196193
if [ -n "${MACOS_ARM64_SHA}" ]; then
197194
cat <<EOFRUBY
198-
sha256 cellar: :any_skip_relocation, arm64_sonoma: "${MACOS_ARM64_SHA}"
199-
sha256 cellar: :any_skip_relocation, arm64_ventura: "${MACOS_ARM64_SHA}"
200-
sha256 cellar: :any_skip_relocation, arm64_monterey: "${MACOS_ARM64_SHA}"
195+
on_arm do
196+
url "https://github.com/ruphy/sshdb/releases/download/v\#{version}/sshdb-macos-aarch64.tar.gz"
197+
sha256 "${MACOS_ARM64_SHA}"
198+
end
201199
EOFRUBY
202200
fi
203201
if [ -n "${MACOS_X86_64_SHA}" ]; then
204202
cat <<EOFRUBY
205-
sha256 cellar: :any_skip_relocation, x86_64_sonoma: "${MACOS_X86_64_SHA}"
206-
sha256 cellar: :any_skip_relocation, x86_64_ventura: "${MACOS_X86_64_SHA}"
207-
sha256 cellar: :any_skip_relocation, x86_64_monterey: "${MACOS_X86_64_SHA}"
208-
EOFRUBY
209-
fi
210-
if [ -n "${LINUX_X86_64_SHA}" ]; then
211-
cat <<EOFRUBY
212-
sha256 cellar: :any_skip_relocation, x86_64_linux: "${LINUX_X86_64_SHA}"
203+
on_intel do
204+
url "https://github.com/ruphy/sshdb/releases/download/v\#{version}/sshdb-macos-x86_64.tar.gz"
205+
sha256 "${MACOS_X86_64_SHA}"
206+
end
213207
EOFRUBY
214208
fi
215209
cat <<EOFRUBY
216210
end
217211
EOFRUBY
218212
fi
219213
220-
cat <<EOFRUBY
221-
def install
222-
if OS.mac?
223-
if Hardware::CPU.arm?
224-
bin_path = "sshdb-macos-aarch64.tar.gz"
225-
else
226-
bin_path = "sshdb-macos-x86_64.tar.gz"
227-
end
228-
elsif OS.linux?
229-
bin_path = "sshdb-linux-x86_64.tar.gz"
230-
end
214+
if [ -n "${LINUX_X86_64_SHA}" ]; then
215+
cat <<EOFRUBY
231216
232-
if bin_path
233-
bin_url = "https://github.com/ruphy/sshdb/releases/download/v\#{version}/\#{bin_path}"
234-
system "curl", "-L", "-o", bin_path, bin_url
235-
system "tar", "xzf", bin_path
236-
bin.install "sshdb"
237-
rm bin_path
238-
else
239-
system "cargo", "install", *std_cargo_args
217+
on_linux do
218+
on_intel do
219+
url "https://github.com/ruphy/sshdb/releases/download/v\#{version}/sshdb-linux-x86_64.tar.gz"
220+
sha256 "${LINUX_X86_64_SHA}"
240221
end
241222
end
223+
EOFRUBY
224+
fi
225+
226+
cat <<'EOFRUBY'
227+
228+
def install
229+
bin.install "sshdb"
230+
end
242231
243232
test do
244233
system "#{bin}/sshdb", "--help"

0 commit comments

Comments
 (0)