v0.1.0 #12
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-tap: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Tap Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: yosev/homebrew-coda | |
| token: ${{ secrets.CODA_HOMEBREW_ACCESS_TOKEN }} | |
| - name: Set Release Name | |
| run: echo "RELEASE_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| - name: Download Release Assets | |
| run: | | |
| curl -L -o coda-darwin-amd64.tar.gz https://github.com/yosev/coda-cli/releases/download/${RELEASE_NAME}/coda-darwin-amd64.tar.gz | |
| curl -L -o coda-darwin-arm64.tar.gz https://github.com/yosev/coda-cli/releases/download/${RELEASE_NAME}/coda-darwin-arm64.tar.gz | |
| - name: Compute SHA256 Sums | |
| run: | | |
| echo "AMD64_SHA256=$(shasum -a 256 coda-darwin-amd64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV | |
| echo "ARM64_SHA256=$(shasum -a 256 coda-darwin-arm64.tar.gz | awk '{print $1}')" >> $GITHUB_ENV | |
| - name: Update Homebrew Cask | |
| run: | | |
| sed -i "s|^ version \".*\"| version \"${RELEASE_NAME}\"|" Casks/coda.rb | |
| sed -i "/on_intel/,/sha256/s|sha256 \".*\"|sha256 \"${AMD64_SHA256}\"|" Casks/coda.rb | |
| sed -i "/on_arm/,/sha256/s|sha256 \".*\"|sha256 \"${ARM64_SHA256}\"|" Casks/coda.rb | |
| - name: Debug Updated Cask File | |
| run: | | |
| echo "Contents of Casks/coda.rb after update:" | |
| cat Casks/coda.rb | |
| - name: Commit Changes | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Casks/coda.rb | |
| git commit -m "Update Cask for version ${RELEASE_NAME}" | |
| git push |