on: release: types: [created] name: Create new formula version jobs: upload-release: name: Create new formula version runs-on: ubuntu-latest steps: - name: Checkout formula repo uses: actions/checkout@v2 with: repository: ${{ github.repository_owner }}/homebrew-makecolors token: ${{ secrets.PUBLISH_FORMULA_TOKEN }} - name: Update formula run: | cat << EOF > Formula/make-colors.rb class MakeColors < Formula desc "Converts a simple list of color definitions to asset catalogs for Xcode and resource XML for Android" homepage "https://github.com/${{ github.repository }}" url "https://github.com/${{ github.repository }}.git", :tag => "${{ github.event.release.tag_name }}", :revision => "${{ github.sha }}" head "https://github.com/${{ github.repository }}.git" license "MIT" depends_on :xcode => ["14.0", :build] def install system "make", "install", "prefix=#{prefix}" end end EOF git config user.name github-actions git config user.email github-actions@github.com git add Formula/make-colors.rb git commit -m "Update formula for ${{ github.event.release.tag_name }}" git push