trigger_build #506
This file contains hidden or 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
| name: π GHA | |
| on: | |
| repository_dispatch: | |
| types: [trigger_build] | |
| env: | |
| BASE_NAME: Blazium_v | |
| GODOT_BASE_BRANCH: blazium-dev | |
| concurrency: | |
| group: ci-${{ github.actor }}-${{ github.event.client_payload.type || 'nightly' }}-runner | |
| cancel-in-progress: true | |
| jobs: | |
| get-latest-sha: | |
| name: π Get Latest SHA & Base Version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build_sha: ${{ steps.get_sha.outputs.sha }} | |
| external_major: ${{ steps.version.outputs.external_major }} | |
| external_minor: ${{ steps.version.outputs.external_minor }} | |
| external_patch: ${{ steps.version.outputs.external_patch }} | |
| external_status: ${{ steps.version.outputs.external_status }} | |
| external_sha: ${{ steps.version.outputs.external_sha }} | |
| major: ${{ steps.new_version.outputs.major }} | |
| minor: ${{ steps.new_version.outputs.minor }} | |
| patch: ${{ steps.new_version.outputs.patch }} | |
| version_string: ${{ steps.new_version.outputs.version_string }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: blazium-games/blazium | |
| ref: ${{ github.event.client_payload.branch || env.GODOT_BASE_BRANCH }} | |
| fetch-depth: 2 | |
| - name: Pull .github folder from ci_cd repository | |
| run: | | |
| git clone --depth=1 https://github.com/blazium-games/ci_cd.git ci_cd_repo | |
| cp -r ci_cd_repo/.github/* .github/ | |
| mv ci_cd_repo/cicd ./ | |
| rm -rf ci_cd_repo | |
| - name: Get Latest Commit SHA | |
| id: get_sha | |
| run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Parse version.py | |
| id: version | |
| uses: ./.github/actions/get-repos-version | |
| with: | |
| file_path: version.py | |
| - name: Generate Changelog.json | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| GITHUB_OWNER: blazium-games | |
| GITHUB_REPO: blazium | |
| BASE_BRANCH: ${{ steps.version.outputs.external_sha }} | |
| CURRENT_BRANCH: ${{ steps.get_sha.outputs.sha }} | |
| MAJOR_VERSION: ${{ steps.version.outputs.external_major }} | |
| MINOR_VERSION: ${{ steps.version.outputs.external_minor }} | |
| PATCH_VERSION: ${{ steps.version.outputs.external_patch }} | |
| BUILD_TYPE: ${{ github.event.client_payload.type || 'nightly' }} | |
| run: | | |
| node ./cicd/scripts/changelog.js $(pwd) | |
| - name: Get Version from Changelog | |
| id: new_version | |
| uses: ./.github/actions/version-from-changelog | |
| with: | |
| file_path: ${{ github.workspace }}/changelog.json | |
| static-checks: | |
| name: π Static checks | |
| needs: get-latest-sha | |
| uses: ./.github/workflows/static_checks.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| web-build: | |
| name: π Web | |
| needs: [get-latest-sha, static-checks] | |
| if: contains(github.event.client_payload.build, 'web') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/web_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| monoglue-build: | |
| name: Mono Glue | |
| needs: [get-latest-sha, static-checks] | |
| if: >- | |
| !github.event.client_payload.run_id && | |
| ( | |
| contains(github.event.client_payload.build, 'monoglue') || | |
| ( | |
| ( | |
| contains(github.event.client_payload.build, 'windows') || | |
| contains(github.event.client_payload.build, 'linux') || | |
| contains(github.event.client_payload.build, 'macos') || | |
| contains(github.event.client_payload.build, 'android') || | |
| contains(github.event.client_payload.build, 'ios') | |
| ) && | |
| ( | |
| contains(github.event.client_payload.build_type, 'editors') || | |
| contains(github.event.client_payload.build_type, 'templates') | |
| ) | |
| ) | |
| ) | |
| uses: ./.github/workflows/mono_glue_build.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| android-build: | |
| name: π€ Android | |
| needs: [monoglue-build, get-latest-sha] | |
| if: contains(github.event.client_payload.build, 'android') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/android_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| ios-build: | |
| name: π iOS | |
| needs: [monoglue-build, get-latest-sha] | |
| if: contains(github.event.client_payload.build, 'ios') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/ios_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| linux-build: | |
| name: π§ Linux | |
| needs: [monoglue-build, get-latest-sha] | |
| if: contains(github.event.client_payload.build, 'linux') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/linux_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| macos-build: | |
| name: π macOS | |
| needs: [monoglue-build, get-latest-sha] | |
| if: contains(github.event.client_payload.build, 'macos') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/macos_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| windows-build: | |
| name: π Windows | |
| needs: [monoglue-build, get-latest-sha] | |
| if: contains(github.event.client_payload.build, 'windows') && !github.event.client_payload.run_id | |
| uses: ./.github/workflows/windows_builds.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| deploy: | |
| name: Deploy | |
| needs: [monoglue-build, windows-build, macos-build, linux-build, android-build, ios-build, get-latest-sha, static-checks] | |
| if: >- | |
| join(github.event.client_payload.deploy, '') != '' && | |
| !failure() && | |
| !cancelled() && | |
| needs.*.result != 'failure' && | |
| needs.*.result != 'cancelled' | |
| uses: ./.github/workflows/deploy_all.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| monoglue-build: ${{ needs.monoglue-build.result }} | |
| windows-build: ${{ needs.windows-build.result }} | |
| macos-build: ${{ needs.macos-build.result }} | |
| linux-build: ${{ needs.linux-build.result }} | |
| android-build: ${{ needs.android-build.result }} | |
| ios-build: ${{ needs.ios-build.result }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} | |
| cleanup: | |
| name: Clean Up | |
| needs: [monoglue-build, windows-build, macos-build, linux-build, android-build, ios-build, get-latest-sha] | |
| if: always() && (failure() || cancelled()) | |
| uses: ./.github/workflows/clean_up.yml | |
| secrets: inherit | |
| with: | |
| build_sha: ${{ needs.get-latest-sha.outputs.build_sha }} | |
| runner_id: ${{ github.event.client_payload.run_id || github.run_id }} | |
| monoglue-build: ${{ needs.monoglue-build.result }} | |
| windows-build: ${{ needs.windows-build.result }} | |
| macos-build: ${{ needs.macos-build.result }} | |
| linux-build: ${{ needs.linux-build.result }} | |
| android-build: ${{ needs.android-build.result }} | |
| ios-build: ${{ needs.ios-build.result }} | |
| new_major: ${{ needs.get-latest-sha.outputs.major }} | |
| new_minor: ${{ needs.get-latest-sha.outputs.minor }} | |
| new_patch: ${{ needs.get-latest-sha.outputs.patch }} | |
| new_version: ${{ needs.get-latest-sha.outputs.version_string }} |