-
Notifications
You must be signed in to change notification settings - Fork 6
74 lines (72 loc) · 2.43 KB
/
trigger_runner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Trigger Build
on:
workflow_dispatch:
inputs:
production:
description: 'Is this a production build?'
required: true
type: boolean
default: false
type:
description: 'Build type (e.g., nightly)'
required: true
default: 'nightly'
branch:
description: 'Branch to build from'
required: true
default: 'blazium-dev'
build_type:
description: 'Build type (comma-separated list like templates, editors)'
required: true
type: string
default: 'templates,editors'
build:
description: 'Platforms to build for (comma-separated list like linux, monoglue, ios, macos, android, web, windows)'
required: true
type: string
default: 'linux,ios,macos,android,web,windows,monoglue'
force:
description: 'Force build?'
required: true
type: boolean
default: true
deploy:
description: 'Build type (comma-separated list like templates, editors)'
required: true
type: string
default: 'templates,editors'
jobs:
dispatch-event:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Send Repository Dispatch Event
run: |
# Convert the comma-separated string inputs into arrays
build_type=$(printf '%s' '${{ inputs.build_type }}' | jq -R -c 'split(",")')
build=$(printf '%s' '${{ inputs.build }}' | jq -R -c 'split(",")')
deploy=$(printf '%s' '${{ inputs.deploy }}' | jq -R -c 'split(",")')
echo $build_type
echo $build
echo $deploy
# Send the repository dispatch event
curl -X POST \
-v \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.PRIVATE_GITHUB_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d "{
\"event_type\": \"trigger_build\",
\"client_payload\": {
\"production\": ${{ inputs.production }},
\"type\": \"${{ inputs.type }}\",
\"branch\": \"${{ inputs.branch }}\",
\"build_type\": $build_type,
\"force\": ${{ inputs.force }},
\"build\": $build,
\"deploy\": $deploy
}
}"