fix: Extract linux checksums properly in Homebrew workflow
Fixes #238 - The workflow was using a shell command instead of extracting the linux checksums like it does for macOS. Now extracts all platform hashes and uses them in the formula.
This commit is contained in:
13
.github/workflows/update-homebrew.yml
vendored
13
.github/workflows/update-homebrew.yml
vendored
@@ -36,11 +36,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -sL "https://github.com/steveyegge/beads/releases/download/${{ steps.release.outputs.tag }}/checksums.txt" -o checksums.txt
|
curl -sL "https://github.com/steveyegge/beads/releases/download/${{ steps.release.outputs.tag }}/checksums.txt" -o checksums.txt
|
||||||
|
|
||||||
- name: Extract macOS checksums
|
- name: Extract checksums
|
||||||
id: checksums
|
id: checksums
|
||||||
run: |
|
run: |
|
||||||
echo "darwin_amd64=$(grep 'darwin_amd64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
echo "darwin_amd64=$(grep 'darwin_amd64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||||
echo "darwin_arm64=$(grep 'darwin_arm64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
echo "darwin_arm64=$(grep 'darwin_arm64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||||
|
echo "linux_amd64=$(grep 'linux_amd64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||||
|
echo "linux_arm64=$(grep 'linux_arm64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Update Homebrew formula
|
- name: Update Homebrew formula
|
||||||
run: |
|
run: |
|
||||||
@@ -62,8 +64,13 @@ jobs:
|
|||||||
end
|
end
|
||||||
|
|
||||||
on_linux do
|
on_linux do
|
||||||
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_linux_amd64.tar.gz"
|
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||||
sha256 "$(grep 'linux_amd64.tar.gz' ../checksums.txt | awk '{print $1}')"
|
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_linux_arm64.tar.gz"
|
||||||
|
sha256 "${{ steps.checksums.outputs.linux_arm64 }}"
|
||||||
|
else
|
||||||
|
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_linux_amd64.tar.gz"
|
||||||
|
sha256 "${{ steps.checksums.outputs.linux_amd64 }}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
|||||||
Reference in New Issue
Block a user