-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
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_template: | ||
description: 'Build templates' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_editors: | ||
description: 'Build editors' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_linux: | ||
description: 'Build for Linux' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_monoglue: | ||
description: 'Build Mono Glue' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_ios: | ||
description: 'Build for iOS' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_macos: | ||
description: 'Build for macOS' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_android: | ||
description: 'Build for Android' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_web: | ||
description: 'Build for Web' | ||
required: true | ||
type: boolean | ||
default: true | ||
build_windows: | ||
description: 'Build for Windows' | ||
required: true | ||
type: boolean | ||
default: true | ||
force: | ||
description: 'Force build' | ||
required: true | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
dispatch-event: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Repository Dispatch Event | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Append selected build types to build_type and build arrays | ||
build_type=() | ||
build=() | ||
deploy=() | ||
if [ "${{ inputs.build_template }}" == "true" ]; then | ||
build_type+=("templates") | ||
deploy+=("templates") | ||
fi | ||
if [ "${{ inputs.build_editors }}" == "true" ]; then | ||
build_type+=("editors") | ||
deploy+=("editors") | ||
fi | ||
if [ "${{ inputs.build_linux }}" == "true" ]; then | ||
build+=("linux") | ||
fi | ||
if [ "${{ inputs.build_monoglue }}" == "true" ]; then | ||
build+=("monoglue") | ||
fi | ||
if [ "${{ inputs.build_ios }}" == "true" ]; then | ||
build+=("ios") | ||
fi | ||
if [ "${{ inputs.build_macos }}" == "true" ]; then | ||
build+=("macos") | ||
fi | ||
if [ "${{ inputs.build_android }}" == "true" ]; then | ||
build+=("android") | ||
fi | ||
if [ "${{ inputs.build_web }}" == "true" ]; then | ||
build+=("web") | ||
fi | ||
if [ "${{ inputs.build_windows }}" == "true" ]; then | ||
build+=("windows") | ||
fi | ||
# Update the curl command with the final payload | ||
curl -X POST \ | ||
-H "Accept: application/vnd.github.everest-preview+json" \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
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[@]}"] | ||
} | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters