Skip to content

Commit

Permalink
Refactor downstream re-build CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 8, 2024
1 parent 3e754a4 commit 0a94b48
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,8 @@ jobs:
trigger-dep-build:
name: Trigger downstream builds
needs: [build]
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
repo: [ 'FasterXML/jackson-databind' ]

steps:
- name: Repository dispatch
uses: peter-evans/repository-dispatch@v3
with:
# Does regular token work within same org?
token: ${{ secrets.REPO_DISPATCH }}
repository: ${{ matrix.repo }}
event-type: jackson-core-pushed
# Could push information on what was built but not yet
client-payload: '{"version": "N/A" }'
# Only for pushes to default branch
if: ${{ github.event_name == 'push' && github.event.ref_name == github.event.repository.default_branch }}
uses: ./.github/workflows/trigger_dep_builds.yml
secrets:
token: ${{ secrets.REPO_DISPATCH }}
29 changes: 29 additions & 0 deletions .github/workflows/trigger_dep_builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Reusable workflow; extracted for maintainability

name: Trigger downstream builds
on:
workflow_call:
secrets:
token:
required: true

jobs:
trigger-dep-build:
name: Trigger downstream builds
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
repo:
- 'FasterXML/jackson-databind'

steps:
- name: Repository dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.token }}
repository: ${{ matrix.repo }}
event-type: jackson-databind-pushed
# Could push information on what was built but not yet
client-payload: '{"version": "N/A" }'

0 comments on commit 0a94b48

Please sign in to comment.