Skip to content

Update Homebrew Formula #271

Update Homebrew Formula

Update Homebrew Formula #271

name: Update Homebrew Formula
# Trigger when release workflow completes successfully
# Note: Using workflow_run instead of release:published because
# releases created by workflows using GITHUB_TOKEN don't trigger release events
on:
workflow_run:
workflows: ["Release CLIO"]
types:
- completed
workflow_dispatch:
inputs:
version:
description: 'Version to update (e.g., 20260210.1)'
required: true
type: string
permissions:
contents: read
jobs:
trigger-homebrew-update:
runs-on: ubuntu-latest
# Only run if the release workflow succeeded (or manual dispatch)
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Extract version
id: version
env:
EVENT_NAME: ${{ github.event_name }}
DISPATCH_VERSION: ${{ github.event.inputs.version }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
VERSION="$DISPATCH_VERSION"
else
# Get the tag from the workflow run
# The release workflow runs on tag push, so we extract from head_branch
VERSION="$HEAD_BRANCH"
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Release version: $VERSION"
- name: Get release tarball URL
id: asset
run: |
VERSION="${{ steps.version.outputs.version }}"
URL="https://github.com/SyntheticAutonomicMind/CLIO/releases/download/${VERSION}/clio-${VERSION}.tar.gz"
echo "url=$URL" >> $GITHUB_OUTPUT
echo "Tarball URL: $URL"
- name: Trigger Homebrew formula update
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.HOMEBREW_PAT }}
repository: SyntheticAutonomicMind/homebrew-SAM
event-type: formula-update
client-payload: |
{
"project": "clio",
"version": "${{ steps.version.outputs.version }}",
"download_url": "${{ steps.asset.outputs.url }}"
}
- name: Notify success
run: |
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "[OK] Homebrew update triggered!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Project: clio"
echo "Version: ${{ steps.version.outputs.version }}"
echo "Tarball: ${{ steps.asset.outputs.url }}"
echo ""
echo "Monitor: https://github.com/SyntheticAutonomicMind/homebrew-SAM/actions"