Skip to content

Commit

Permalink
Workflow: Add repo dispatch jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
3j14 committed Nov 18, 2024
1 parent ed4062a commit 4be8cb3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@ jobs:
name: python-package-distributions
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
dispatch-homebrew-update:
name: Dispatch Homebrew update
needs:
- publish
runs-on: ubuntu-latest
environment:
repo: '3j14/homebrew-bumgr'
data: '{"event_type": "update", "client_payload": {"version": "${{ github.event.release.tag_name }}"}'
timeout-minutes: 1
steps:
- name: Dispatch Homebrew update
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.HOMEBREW_BUMGR_DISPATCH_PAT }}" \
--request POST \
--data $data https://api.github.com/repos/$repo/dispatches
30 changes: 30 additions & 0 deletions .github/workflows/update-formula.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Update Homebrew Formula (Dispatch)

on:
workflow_dispatch:
inputs:
version:
description: 'Bumgr version used in the Formula'
required: true

permissions:
contents: read

jobs:
dispatch-homebrew-update:
name: Dispatch Homebrew update
needs:
- publish
runs-on: ubuntu-latest
environment:
repo: '3j14/homebrew-bumgr'
data: '{"event_type": "update", "client_payload": {"version": "${{ github.event.inputs.version }}"}'
timeout-minutes: 1
steps:
- name: Dispatch Homebrew update
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.HOMEBREW_BUMGR_DISPATCH_PAT }}" \
--request POST \
--data $data https://api.github.com/repos/$repo/dispatches

0 comments on commit 4be8cb3

Please sign in to comment.