-
Notifications
You must be signed in to change notification settings - Fork 4
219 lines (200 loc) Β· 9.01 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
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 }}