Skip to content

Commit a327af9

Browse files
authored
Merge pull request #12 from git-mastery/woojiahao/auto-trigger-publish
Listen for workflow runs
2 parents 307f6ef + 44518a6 commit a327af9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/bump-version.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
if: github.event.pull_request.merged == true
1111
runs-on: ubuntu-latest
1212

13+
concurrency:
14+
group: tag-main
15+
cancel-in-progress: false
16+
1317
permissions:
1418
contents: write
1519

.github/workflows/publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build and release Git-Mastery CLI
22

33
on:
4+
workflow_run:
5+
workflows: [Bump version tag on merge]
6+
types:
7+
- completed
8+
branches:
9+
- main
410
workflow_dispatch:
511
push:
612
tags:
@@ -18,6 +24,7 @@ jobs:
1824
matrix:
1925
os: [ubuntu-latest, ubuntu-24.04-arm]
2026
runs-on: ${{ matrix.os }}
27+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2128

2229
steps:
2330
- name: Checkout source
@@ -74,6 +81,7 @@ jobs:
7481
matrix:
7582
os: [ubuntu-latest, ubuntu-24.04-arm]
7683
runs-on: ${{ matrix.os }}
84+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
7785

7886
steps:
7987
- name: Checkout source
@@ -187,6 +195,7 @@ jobs:
187195
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188196

189197
debian-publish-apt:
198+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
190199
needs: debian-build
191200
permissions: write-all
192201
uses: git-mastery/gitmastery-apt-repo/.github/workflows/debian-apt-repo.yml@main
@@ -199,6 +208,7 @@ jobs:
199208
# on supporting that first
200209
needs: linux-build
201210
runs-on: ubuntu-latest
211+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
202212

203213
env:
204214
ARCHITECTURE: amd64
@@ -293,6 +303,7 @@ jobs:
293303
294304
windows:
295305
runs-on: windows-latest
306+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
296307

297308
steps:
298309
- name: Checkout source
@@ -339,6 +350,7 @@ jobs:
339350
- os: macos-latest
340351
arch: arm64
341352
runs-on: ${{ matrix.os }}
353+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
342354
outputs:
343355
sha256-arm64: ${{ steps.checksum-arm64.outputs.sha256 }}
344356
sha256-amd64: ${{ steps.checksum-amd64.outputs.sha256 }}
@@ -389,6 +401,7 @@ jobs:
389401

390402
macos-publish:
391403
runs-on: ubuntu-latest
404+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
392405

393406
needs: macos-build
394407

@@ -447,6 +460,7 @@ jobs:
447460
os: [macos-15-intel, macos-latest]
448461

449462
runs-on: ${{ matrix.os }}
463+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
450464

451465
needs: macos-publish
452466

0 commit comments

Comments
 (0)