v0.0.67 #16
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 brew formula | |
on: | |
release: | |
types: [released] | |
jobs: | |
update-brew-formula: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: |- | |
TARGET_DIR=$(mktemp -d) | |
CHECKSUM=$(curl -sL "${{ github.event.release.tarball_url }}" | sha256sum | cut -d ' ' -f 1) | |
if [ -z $CHECKSUM ]] | |
then | |
exit 1 | |
fi | |
git config --global user.email jong@chan.moe | |
git config --global user.name pbkit | |
git clone --single-branch --branch main --depth 1 "https://disjukr:${{ secrets.GH_PAT_FOR_HOMEBREW_TAP }}@github.com/pbkit/homebrew-tap.git" $TARGET_DIR | |
cd $TARGET_DIR | |
sed -i -e "s|url \".*\"|url \"${{ github.event.release.tarball_url }}\"|"\ | |
-e "s|sha256 \".*\"|sha256 \"$CHECKSUM\"|" Formula/pbkit.rb | |
git add . | |
git commit -m "Bump pbkit to ${{ github.event.release.tag_name }}" | |
git push origin main | |
cd - |