Skip to content

trigger_build

trigger_build #306

Workflow file for this run

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-engine/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-engine/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-engine
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 }}
run: |
node ./cicd/scripts/changelog.js $(pwd)
- name: Get Verson of 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: contains(github.event.client_payload.build, 'monoglue') && !github.event.client_payload.run_id
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]
if: ${{ always() }}
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 }}