Archived
fix(ci): integrate homebrew update into release workflow
GITHUB_TOKEN events don't trigger other workflows, so the separate update-homebrew workflow never ran. Move the logic directly into the release workflow. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9833d3a2ec
commit
1370ed6deb
2 files changed
+86
-106
No files matched your search
@@ -118,3 +118,89 @@ jobs:
|
||||
files: release/*
|
||||
draft: false
|
||||
prerelease: ${{ contains(github.ref, '-') }}
|
||||
|
||||
- name: Get checksums for Homebrew
|
||||
id: checksums
|
||||
run: |
|
||||
cd release
|
||||
echo "macos_arm64_sha=$(grep barn-macos-arm64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "macos_x64_sha=$(grep barn-macos-x64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "linux_arm64_sha=$(grep barn-linux-arm64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "linux_x64_sha=$(grep barn-linux-x64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Checkout homebrew tap
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: samson-media/homebrew-tap
|
||||
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
path: homebrew-tap
|
||||
|
||||
- name: Update Homebrew formula
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
MACOS_ARM64_SHA: ${{ steps.checksums.outputs.macos_arm64_sha }}
|
||||
MACOS_X64_SHA: ${{ steps.checksums.outputs.macos_x64_sha }}
|
||||
LINUX_ARM64_SHA: ${{ steps.checksums.outputs.linux_arm64_sha }}
|
||||
LINUX_X64_SHA: ${{ steps.checksums.outputs.linux_x64_sha }}
|
||||
run: |
|
||||
cat > homebrew-tap/Formula/barn.rb << EOF
|
||||
class Barn < Formula
|
||||
desc "Cross-platform job daemon for media processing"
|
||||
homepage "https://github.com/samson-media/barn"
|
||||
version "${VERSION}"
|
||||
license "MIT"
|
||||
|
||||
on_macos do
|
||||
on_arm do
|
||||
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-arm64"
|
||||
sha256 "${MACOS_ARM64_SHA}"
|
||||
|
||||
def install
|
||||
bin.install "barn-macos-arm64" => "barn"
|
||||
end
|
||||
end
|
||||
|
||||
on_intel do
|
||||
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-x64"
|
||||
sha256 "${MACOS_X64_SHA}"
|
||||
|
||||
def install
|
||||
bin.install "barn-macos-x64" => "barn"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_linux do
|
||||
on_arm do
|
||||
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-arm64"
|
||||
sha256 "${LINUX_ARM64_SHA}"
|
||||
|
||||
def install
|
||||
bin.install "barn-linux-arm64" => "barn"
|
||||
end
|
||||
end
|
||||
|
||||
on_intel do
|
||||
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-x64"
|
||||
sha256 "${LINUX_X64_SHA}"
|
||||
|
||||
def install
|
||||
bin.install "barn-linux-x64" => "barn"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "barn", shell_output("#{bin}/barn --version")
|
||||
end
|
||||
end
|
||||
EOF
|
||||
|
||||
- name: Commit and push to Homebrew tap
|
||||
run: |
|
||||
cd homebrew-tap
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git add Formula/barn.rb
|
||||
git diff --staged --quiet || git commit -m "Update barn to ${{ steps.version.outputs.version }}"
|
||||
git push
|
||||
Reference in new issue
Block a user