Skip to content

Commit f3ad1fa

Browse files
authored
Fix/homebrew workflow (#26)
* build: homebrew workflow sha256 field fix * build: remove temporary brew workflow dispatch * build: update homebrew tap repo name
1 parent 7452146 commit f3ad1fa

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

.github/workflows/update-homebrew-tap.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: Update Homebrew Tap
33
on:
44
release:
55
types: [published]
6-
workflow_dispatch:
7-
inputs:
8-
version:
9-
description: "Version tag to use (e.g. v0.1.2)"
10-
required: true
116

127
jobs:
138
update-tap:
@@ -20,14 +15,7 @@ jobs:
2015
- name: Get release version
2116
id: get_version
2217
run: |
23-
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
24-
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
25-
elif [[ -n "${{ github.event.inputs.version }}" ]]; then
26-
echo "tag=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
27-
else
28-
echo "No version found. Exiting."
29-
exit 1
30-
fi
18+
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
3119
3220
- name: Download release assets and compute SHA256
3321
id: shasums
@@ -60,7 +48,7 @@ jobs:
6048
6149
- name: Clone Homebrew tap repo
6250
run: |
63-
git clone https://x-access-token:${{ secrets.TAP_GITHUB_TOKEN }}@github.com/elva-labs/homebrew-awsesh.git ../tap
51+
git clone https://x-access-token:${{ secrets.TAP_GITHUB_TOKEN }}@github.com/elva-labs/homebrew-elva.git ../tap
6452
6553
- name: Commit updated formula
6654
run: |

homebrew/formula/awsesh.rb.in

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@ class Awsesh < Formula
33
homepage "https://github.com/elva-labs/awsesh"
44
license "MIT"
55

6-
os = OS.mac? ? "darwin" : "linux"
7-
arch = Hardware::CPU.intel? ? "amd64" : "arm64"
8-
binary = "sesh-#{os}-#{arch}"
6+
on_macos do
7+
if Hardware::CPU.intel?
8+
url "https://github.com/elva-labs/awsesh/releases/download/__VERSION__/sesh-darwin-amd64"
9+
sha256 "__SHA_DARWIN_AMD64__"
10+
elsif Hardware::CPU.arm?
11+
url "https://github.com/elva-labs/awsesh/releases/download/__VERSION__/sesh-darwin-arm64"
12+
sha256 "__SHA_DARWIN_ARM64__"
13+
end
14+
end
915

10-
url "https://github.com/elva-labs/awsesh/releases/download/__VERSION__/#{binary}"
11-
sha256 "__SHA_#{os.upcase}_#{arch.upcase}__"
16+
on_linux do
17+
if Hardware::CPU.intel?
18+
url "https://github.com/elva-labs/awsesh/releases/download/__VERSION__/sesh-linux-amd64"
19+
sha256 "__SHA_LINUX_AMD64__"
20+
elsif Hardware::CPU.arm?
21+
url "https://github.com/elva-labs/awsesh/releases/download/__VERSION__/sesh-linux-arm64"
22+
sha256 "__SHA_LINUX_ARM64__"
23+
end
24+
end
1225

1326
def install
1427
os = OS.mac? ? "darwin" : "linux"

0 commit comments

Comments
 (0)