Archived
- Add macos-13 runner for x64 builds - Update homebrew workflow for macos-x64 binary Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
107 lines
3.6 KiB
YAML
107 lines
3.6 KiB
YAML
name: Update Homebrew
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
update-homebrew:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get release info
|
|
id: release
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/v}
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
# Get checksums from release
|
|
curl -sL "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/SHA256SUMS" -o SHA256SUMS
|
|
cat SHA256SUMS
|
|
|
|
MACOS_ARM64_SHA=$(grep barn-macos-arm64 SHA256SUMS | awk '{print $1}')
|
|
MACOS_X64_SHA=$(grep barn-macos-x64 SHA256SUMS | awk '{print $1}')
|
|
LINUX_ARM64_SHA=$(grep barn-linux-arm64 SHA256SUMS | awk '{print $1}')
|
|
LINUX_X64_SHA=$(grep barn-linux-x64 SHA256SUMS | awk '{print $1}')
|
|
|
|
echo "macos_arm64_sha=$MACOS_ARM64_SHA" >> $GITHUB_OUTPUT
|
|
echo "macos_x64_sha=$MACOS_X64_SHA" >> $GITHUB_OUTPUT
|
|
echo "linux_arm64_sha=$LINUX_ARM64_SHA" >> $GITHUB_OUTPUT
|
|
echo "linux_x64_sha=$LINUX_X64_SHA" >> $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 formula
|
|
env:
|
|
VERSION: ${{ steps.release.outputs.version }}
|
|
MACOS_ARM64_SHA: ${{ steps.release.outputs.macos_arm64_sha }}
|
|
MACOS_X64_SHA: ${{ steps.release.outputs.macos_x64_sha }}
|
|
LINUX_ARM64_SHA: ${{ steps.release.outputs.linux_arm64_sha }}
|
|
LINUX_X64_SHA: ${{ steps.release.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
|
|
run: |
|
|
cd homebrew-tap
|
|
git config user.name "GitHub Actions"
|
|
git config user.email "actions@github.com"
|
|
git add Formula/barn.rb
|
|
git commit -m "Update barn to ${{ steps.release.outputs.version }}"
|
|
git push
|