mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-23 14:10:50 -05:00
GraalVM native-image can't cross-compile architectures, and GitHub's Intel macos-13 runners queue for hours and are being deprecated, so darwin/amd64 was dropped — leaving 'brew install' and the install script with no Intel binary to fetch (404). Add a release job that runs an x86_64 GraalVM under Rosetta 2 on the Apple Silicon runner to produce a genuine x86_64 binary, re-wire the Homebrew bump to fill the darwin/amd64 SHA, and add a manually-triggered workflow to smoke-test the Rosetta build without cutting a release. Closes #2
78 lines
3.2 KiB
YAML
78 lines
3.2 KiB
YAML
name: Homebrew Bump
|
|
|
|
# Triggered after release.yml succeeds on a version tag.
|
|
# Opens a PR in floci-io/homebrew-floci with the new version and SHA256.
|
|
#
|
|
# Required secrets: GH_TOKEN (PAT with repo scope on homebrew-floci repo)
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: [Release]
|
|
types: [completed]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
bump:
|
|
name: Bump Homebrew formula
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: |
|
|
TAG="${{ github.event.workflow_run.head_branch }}"
|
|
echo "version=${TAG}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Download release checksums
|
|
run: |
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
curl -fsSL "https://github.com/floci-io/floci-cli/releases/download/${VERSION}/sha256sums.txt" \
|
|
-o sha256sums.txt
|
|
cat sha256sums.txt
|
|
|
|
- name: Extract per-platform SHA256
|
|
id: sha
|
|
run: |
|
|
echo "darwin_arm64=$(grep 'floci-darwin-arm64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
|
echo "darwin_amd64=$(grep 'floci-darwin-amd64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
|
echo "linux_amd64=$(grep 'floci-linux-amd64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
|
echo "linux_arm64=$(grep 'floci-linux-arm64' sha256sums.txt | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout homebrew tap
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: floci-io/homebrew-floci
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
path: homebrew-floci
|
|
|
|
- name: Update formula
|
|
run: |
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
FORMULA="homebrew-floci/Formula/floci.rb"
|
|
|
|
sed -i "s/version \".*\"/version \"${VERSION}\"/" "$FORMULA"
|
|
sed -i "s|releases/download/[^/]*/|releases/download/${VERSION}/|g" "$FORMULA"
|
|
sed -i "s/{{VERSION}}/${VERSION}/g" "$FORMULA"
|
|
sed -i "s/{{SHA256_DARWIN_ARM64}}/${{ steps.sha.outputs.darwin_arm64 }}/g" "$FORMULA"
|
|
sed -i "s/{{SHA256_DARWIN_AMD64}}/${{ steps.sha.outputs.darwin_amd64 }}/g" "$FORMULA"
|
|
sed -i "s/{{SHA256_LINUX_AMD64}}/${{ steps.sha.outputs.linux_amd64 }}/g" "$FORMULA"
|
|
sed -i "s/{{SHA256_LINUX_ARM64}}/${{ steps.sha.outputs.linux_arm64 }}/g" "$FORMULA"
|
|
|
|
sed -i "/darwin-arm64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.darwin_arm64 }}\"/ }" "$FORMULA"
|
|
sed -i "/darwin-amd64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.darwin_amd64 }}\"/ }" "$FORMULA"
|
|
sed -i "/linux-amd64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.linux_amd64 }}\"/ }" "$FORMULA"
|
|
sed -i "/linux-arm64/ { n; s/sha256 \".*\"/sha256 \"${{ steps.sha.outputs.linux_arm64 }}\"/ }" "$FORMULA"
|
|
|
|
- name: Open PR
|
|
uses: peter-evans/create-pull-request@v7
|
|
with:
|
|
token: ${{ secrets.GH_TOKEN }}
|
|
path: homebrew-floci
|
|
commit-message: "floci ${{ steps.version.outputs.version }}"
|
|
title: "floci ${{ steps.version.outputs.version }}"
|
|
body: "Automated bump from floci-cli release workflow."
|
|
branch: "bump-${{ steps.version.outputs.version }}"
|