0.1.2 #3
Workflow file for this run
This file contains hidden or 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 Tap | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| update-homebrew-tap: | |
| name: Update Homebrew tap | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download release assets and update tap | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| VERSION: ${{ github.event.release.tag_name }} | |
| run: | | |
| # Download both macOS DMGs from the release | |
| gh release download "${VERSION}" \ | |
| --repo eddmann/santa-lang-workbench \ | |
| --pattern "santa-lang-workbench-*-macos-*.dmg" | |
| # Calculate SHA256 for each architecture | |
| SHA_ARM64=$(shasum -a 256 santa-lang-workbench-${VERSION}-macos-arm64.dmg | cut -d' ' -f1) | |
| SHA_AMD64=$(shasum -a 256 santa-lang-workbench-${VERSION}-macos-amd64.dmg | cut -d' ' -f1) | |
| echo "ARM64 SHA256: ${SHA_ARM64}" | |
| echo "AMD64 SHA256: ${SHA_AMD64}" | |
| # Clone homebrew-tap and update the cask | |
| git clone https://x-access-token:${TAP_TOKEN}@github.com/eddmann/homebrew-tap.git | |
| cd homebrew-tap | |
| # Update version | |
| sed -i "s/version \".*\"/version \"${VERSION}\"/" Casks/santa-lang-workbench.rb | |
| # Update ARM64 SHA256 | |
| sed -i "s/sha256 arm: \"[^\"]*\"/sha256 arm: \"${SHA_ARM64}\"/" Casks/santa-lang-workbench.rb | |
| # Update AMD64 SHA256 (only on sha256 line, not arch line) | |
| sed -i "s/^\([[:space:]]*\)intel: \"[^\"]*\"/\1intel: \"${SHA_AMD64}\"/" Casks/santa-lang-workbench.rb | |
| # Commit and push | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Casks/santa-lang-workbench.rb | |
| git commit -m "chore(santa-lang-workbench): update to ${VERSION}" | |
| git push |