Skip to content

Commit

Permalink
Unified workflows for distributable dispatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Jul 24, 2024
1 parent 1845a51 commit d35d591
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 39 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/distributable-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Distributable Dispatch

on:
workflow_run:
workflows: ["Windows Test", "MacOS Test", "Linux Test", "Linux Sanitizer Test"]
types:
- completed
branches: ['v*.*.*', 'master']

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
windows-distributable:
name: Windows Distributable Dispatch
runs-on: ubuntu-latest
steps:
- name: Windows Workflow Dispatch
uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: metacall
repo: distributable-windows
github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: ci.yml
wait_workflow: true
client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}'
ref: ${{ github.head_ref || github.ref_name }}

macos-distributable:
name: MacOS Distributable Dispatch
runs-on: ubuntu-latest
steps:
- name: MacOS Workflow Dispatch
uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: metacall
repo: distributable-macos
github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: ci.yml
wait_workflow: true
client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}'
ref: ${{ github.head_ref || github.ref_name }}

linux-distributable:
name: Linux Distributable Dispatch
runs-on: ubuntu-latest
steps:
- name: Linux Workflow Dispatch
uses: convictional/trigger-workflow-and-wait@v1.6.1
with:
owner: metacall
repo: distributable-linux
github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
workflow_file_name: ci.yml
wait_workflow: true
client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}'
ref: ${{ github.head_ref || github.ref_name }}
13 changes: 0 additions & 13 deletions .github/workflows/linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,3 @@ jobs:
env:
METACALL_BUILD_TYPE: ${{ matrix.build }}
METACALL_BASE_IMAGE: ${{ matrix.image }}

trigger_dist_linux:
needs: linux-test
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- name: Linux Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
repository: metacall/distributable-linux
event-type: test-trigger
client-payload: '{"ref": "${{ github.ref }}"}'
13 changes: 0 additions & 13 deletions .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,3 @@ jobs:
bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS
env:
METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests

trigger_dist_macos:
needs: mac-test
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- name: MacOS Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
repository: metacall/distributable-macos
event-type: test-trigger
client-payload: '{"ref": "${{ github.ref }}"}'
13 changes: 0 additions & 13 deletions .github/workflows/windows-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,3 @@ jobs:
run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS"
env:
METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests

trigger_dist_windows:
needs: windows-test
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- name: Windows Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }}
repository: metacall/distributable-windows
event-type: test-trigger
client-payload: '{"ref": "${{ github.ref }}"}'

0 comments on commit d35d591

Please sign in to comment.