0.0.10 (2025-01-26) #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Homebrew Formula Automatically | |
on: | |
release: | |
types: [published] | |
jobs: | |
update-formula: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Homebrew Tap Repository | |
uses: actions/checkout@v4.1.7 | |
with: | |
repository: AbundantSalmon/homebrew-quick-capacities | |
token: ${{ secrets.PAT }} | |
- name: Fetch Release Details | |
id: release | |
run: | | |
VERSION=${{ github.event.release.tag_name }} | |
TAR_URL="https://github.com/AbundantSalmon/QuickCapacities/releases/download/$VERSION/qc.tar.gz" | |
echo "version=$VERSION" >> $GITHUB_ENV | |
echo "tarball_url=$TAR_URL" >> $GITHUB_ENV | |
- name: Download Tarball | |
run: curl -L ${{ env.tarball_url }} -o qc.tar.gz | |
- name: Compute SHA-256 | |
id: sha256 | |
run: echo "sha256=$(shasum -a 256 qc.tar.gz | awk '{print $1}')" >> $GITHUB_ENV | |
- name: Configure Git | |
run: | | |
git config --global user.name GitHub Actions | |
git config user.email github-actions@github.com | |
- name: Update Formula | |
run: | | |
FORMULA="quick-capacities.rb" | |
sed -i "s|url .*|url \"${{ env.tarball_url }}\"|" $FORMULA | |
sed -i "s|sha256 .*|sha256 \"${{ env.sha256 }}\"|" $FORMULA | |
sed -i "s|version .*|version \"${{ env.version }}\"|" $FORMULA | |
git add $FORMULA | |
git commit -m "Update formula to version ${{ env.version }}" | |
- name: Push Updated Formula | |
run: git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} |