Skip to content

Create update-homebrew-tap.yml #2

Create update-homebrew-tap.yml

Create update-homebrew-tap.yml #2

name: Update Homebrew Cask
on:
push: # remove me
workflow_dispatch: # manual
release:
types: [published]
jobs:
update-cask:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Calculate sha256 checksum
id: checksum
run: |
curl -L -o Calendr.zip https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/Calendr.zip
echo "::set-output name=sha256::$(sha256sum Calendr.zip | awk '{ print $1 }')"
- name: Update Homebrew Cask
run: |
git clone https://github.com/pakerwreah/homebrew-calendr
cd homebrew-calendr
sed -i "s|version \".*\"|version \"${{ github.event.release.tag_name }}\"|" Calendr.rb
sed -i "s|sha256 \".*\"|sha256 \"${{ steps.checksum.outputs.sha256 }}\"|" Calendr.rb
git add Calendr.rb
git commit -m "Update Calendr to version ${{ github.event.release.tag_name }}"
git push