Skip to content

Release 0.5.1

Release 0.5.1 #6

name: Update Homebrew Formula
on:
release:
types: [published, released]
jobs:
update-formula:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests
- name: Clone Homebrew Tap Repo
run: git clone https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/cdemers/homebrew-tools.git
- name: Update Formula
run: |
VERSION=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
sed -i "s/version \".*\"/version \"$VERSION\"/" homebrew-tools/Formulas/question.rb
sed -i "s|url \".*\"|url \"https://github.com/cdemers/question/releases/download/$VERSION/question.tgz\"|" homebrew-tools/Formulas/question.rb
- name: Commit and Push Formula
run: |
cd homebrew-tools
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Formulas/question.rb
git commit -m "Update question formula to version $VERSION"
git push