Homebrew Tap #14
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: Homebrew Tap | |
on: | |
workflow_dispatch: | |
inputs: | |
push: | |
description: Push the formula to the tap repository? | |
required: false | |
default: true | |
type: boolean | |
tag: | |
description: The git tag for the formula | |
required: true | |
type: string | |
workflow_call: | |
inputs: | |
push: | |
description: Push the formula to the tap repository? | |
required: false | |
default: true | |
type: boolean | |
tag: | |
description: The git tag to build on | |
required: true | |
type: string | |
secrets: | |
GH_APP_KEY: | |
description: GitHub App private key | |
required: true | |
jobs: | |
update_tap: | |
name: Homebrew | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
id: setup | |
uses: duplocloud/duploctl/.github/actions/setup@main | |
with: | |
ref: ${{ inputs.tag }} | |
optionals: "[build]" | |
app-id: ${{ vars.GH_APP_ID }} | |
private-key: ${{ secrets.GH_APP_KEY }} | |
repositories: homebrew-tap | |
- name: Gen Formula | |
run: >- | |
./scripts/formula.py | |
--tag ${{ inputs.tag }} | |
--push ${{ inputs.push }} | |
--token ${{ steps.setup.outputs.token }} | |
# - name: Checkout Tap | |
# uses: actions/checkout@v4 | |
# if: inputs.push == true | |
# with: | |
# repository: 'duplocloud/homebrew-tap' | |
# path: 'homebrew-tap' | |
# token: ${{ steps.setup.outputs.token }} | |
# - name: Copy Formula | |
# if: inputs.push == true | |
# run: cp dist/duploctl.rb homebrew-tap/Formula/duploctl.rb | |
# - name: Commit Formula | |
# if: inputs.push == true | |
# working-directory: homebrew-tap | |
# run: | | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "Duplo Bot" | |
# git add Formula/duploctl.rb | |
# git commit -m "Update duploctl to ${{ inputs.tag }}" | |
# git tag duploctl-${{ inputs.tag }} | |
# - name: Push changes | |
# uses: ad-m/github-push-action@master | |
# if: inputs.push == true | |
# with: | |
# github_token: ${{ secrets.GHA_TOKEN }} | |
# branch: main | |
# directory: homebrew-tap | |
# repository: duplocloud/homebrew-tap | |
# tags: true | |