| 1 |
name: Publish to Homebrew |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_run: |
| 5 |
workflows: ["Upload Python Package"] |
| 6 |
types: |
| 7 |
- completed |
| 8 |
|
| 9 |
jobs: |
| 10 |
deploy: |
| 11 |
runs-on: macos-latest |
| 12 |
if: ${{ github.repository == 'commitizen-tools/commitizen' && github.event.workflow_run.conclusion == 'success' }} |
| 13 |
steps: |
| 14 |
- name: Checkout |
| 15 |
uses: actions/checkout@v7 |
| 16 |
- name: Set up Python |
| 17 |
uses: astral-sh/setup-uv@v7 |
| 18 |
- name: Install dependencies |
| 19 |
run: uv pip install -U commitizen |
| 20 |
- name: Set Project version env variable |
| 21 |
run: | |
| 22 |
echo "project_version=$(cz version --project)" >> $GITHUB_ENV |
| 23 |
- name: Update Homebrew formula |
| 24 |
uses: dawidd6/action-homebrew-bump-formula@v8 |
| 25 |
with: |
| 26 |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |
| 27 |
formula: commitizen |
| 28 |
tag: v${{ env.project_version }} |
| 29 |
force: true |