Skip to content

Commit f83dee3

Browse files
authored
Fully setup input for nightly build, and fail building job if no zip generated (#359)
1 parent 6f9b7da commit f83dee3

File tree

6 files changed

+108
-35
lines changed

6 files changed

+108
-35
lines changed

.github/workflows/build_android.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ jobs:
120120
# TODO add handling cmake_extras
121121
python scripts/build_scripts/build_zips.py --platform=android --unity_root=$UNITY_ROOT_DIR --apis=${{ inputs.apis }}
122122
123+
- name: Check zip file
124+
shell: bash
125+
run: |
126+
if [ -f android_unity/*.zip ]; then
127+
echo "android_unity zip created."
128+
else
129+
echo "Fail to create android_unity zip."
130+
exit 1
131+
fi
132+
123133
- name: Upload Build
124134
uses: actions/upload-artifact@v2
125135
with:

.github/workflows/build_ios.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ jobs:
107107
# TODO add handling cmake_extras
108108
python scripts/build_scripts/build_zips.py --platform=ios --unity_root=$UNITY_ROOT_DIR --apis=${{ inputs.apis }}
109109
110+
- name: Check zip file
111+
shell: bash
112+
run: |
113+
if [ -f ios_unity/*.zip ]; then
114+
echo "ios_unity zip created."
115+
else
116+
echo "Fail to create ios_unity zip."
117+
exit 1
118+
fi
119+
110120
- name: Upload Build
111121
uses: actions/upload-artifact@v2
112122
with:

.github/workflows/build_linux.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ jobs:
112112
run: |
113113
# TODO add handling cmake_extras
114114
python scripts/build_scripts/build_zips.py --platform=linux --use_boringssl=true --unity_root=$UNITY_ROOT_DIR --apis=${{ inputs.apis }}
115+
116+
- name: Check zip file
117+
shell: bash
118+
run: |
119+
if [ -f linux_unity/*.zip ]; then
120+
echo "linux_unity zip created."
121+
else
122+
echo "Fail to create linux_unity zip."
123+
exit 1
124+
fi
115125
116126
- name: Upload Build
117127
uses: actions/upload-artifact@v2

.github/workflows/build_macos.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ jobs:
119119
# TODO add handling cmake_extras
120120
python scripts/build_scripts/build_zips.py --platform=macos --unity_root=$UNITY_ROOT_DIR --use_boringssl --architecture=x86_64 --architecture=arm64 --apis=${{ inputs.apis }}
121121
122+
- name: Check zip file
123+
shell: bash
124+
run: |
125+
if [ -f macos_unity/*.zip ]; then
126+
echo "macos_unity zip created."
127+
else
128+
echo "Fail to create macos_unity zip."
129+
exit 1
130+
fi
131+
122132
- name: Upload Build
123133
uses: actions/upload-artifact@v2
124134
with:

.github/workflows/build_starter.yml

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ jobs:
6161
outputs:
6262
platform: ${{ steps.set_outputs.outputs.platform }}
6363
release_label: ${{ steps.set_outputs.outputs.release_label }}
64+
unity_version: ${{ steps.set_outputs.outputs.unity_version }}
65+
apis: ${{ steps.set_outputs.outputs.apis }}
66+
release_version: ${{ steps.set_outputs.outputs.release_version }}
67+
should_trigger_package: ${{ steps.set_outputs.outputs.should_trigger_package }}
68+
skipIntegrationTests: ${{ steps.set_outputs.outputs.skipIntegrationTests }}
69+
firebase_cpp_sdk_version: ${{ steps.set_outputs.outputs.firebase_cpp_sdk_version }}
70+
unity_branch: ${{ steps.set_outputs.outputs.unity_branch }}
71+
additional_cmake_flags: ${{ steps.set_outputs.outputs.additional_cmake_flags }}
6472
steps:
6573
- uses: actions/checkout@v2
6674
with:
@@ -79,9 +87,24 @@ jobs:
7987
platform=$( python scripts/gha/print_matrix_configuration.py -c -w config -k platform -o "${{ github.event.inputs.platforms }}" )
8088
echo "::set-output name=platform::${platform}"
8189
echo "::set-output name=release_label::${{ github.event.inputs.release_version }}-${{ github.event.inputs.rc_index }}"
90+
echo "::set-output name=release_version::${{ github.event.inputs.release_version }}"
91+
echo "::set-output name=apis::${{ github.event.inputs.apis }}"
92+
echo "::set-output name=unity_version::${{ github.event.inputs.unity_version }}"
93+
echo "::set-output name=should_trigger_package::${{ github.event.inputs.should_trigger_package }}"
94+
echo "::set-output name=skipIntegrationTests::${{ github.event.inputs.skipIntegrationTests }}"
95+
echo "::set-output name=unity_branch::${{ github.event.inputs.unity_branch }}"
96+
echo "::set-output name=additional_cmake_flags::${{ github.event.inputs.unity_branch }}"
8297
else
8398
echo "::set-output name=platform::'Android,iOS,Windows,macOS,Linux'"
8499
echo "::set-output name=release_label::nightly-$(date "+%Y%m%d-%H%M%S")"
100+
echo "::set-output name=release_version::'NoVersion'"
101+
echo "::set-output name=apis::'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'"
102+
echo "::set-output name=unity_version::'2019'"
103+
echo "::set-output name=should_trigger_package::true"
104+
echo "::set-output name=skipIntegrationTests::'0'"
105+
echo "::set-output name=firebase_cpp_sdk_version::''"
106+
echo "::set-output name=unity_branch::''"
107+
echo "::set-output name=additional_cmake_flags::''"
85108
fi
86109
87110
- name: Print output
@@ -92,104 +115,104 @@ jobs:
92115
update_versions:
93116
uses: ./.github/workflows/update_versions.yml
94117
needs: check_and_prepare
95-
if: (github.event.inputs.release_version!='NoVersion')
118+
if: (needs.check_and_prepare.outputs.release_version!='NoVersion')
96119
with:
97120
triggered_by_callable: true
98-
base_branch: ${{ github.event.inputs.unity_branch }}
99-
package_version_number: ${{ github.event.inputs.release_version }}
100-
cpp_release_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
121+
base_branch: ${{ needs.check_and_prepare.outputs.unity_branch }}
122+
package_version_number: ${{ needs.check_and_prepare.outputs.release_version }}
123+
cpp_release_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
101124
secrets: inherit
102125

103126
decide_build_branch:
104-
needs: update_versions
127+
needs: [check_and_prepare,update_versions]
105128
runs-on: ubuntu-latest
106129
if: always()
107130
outputs:
108131
build_branch: ${{ steps.decide_branch.outputs.branch }}
109132
steps:
110133
- id: decide_branch
111134
run: |
112-
if [[ "${{ github.event.inputs.release_version }}" == "'NoVersion'" ]]; then
135+
if [[ "${{ needs.check_and_prepare.outputs.release_version }}" == "'NoVersion'" ]]; then
113136
# Triggered by callable
114-
echo "::set-output name=branch::${{ github.event.inputs.unity_branch }}"
137+
echo "::set-output name=branch::${{ needs.check_and_prepare.outputs.unity_branch }}"
115138
else
116139
echo "::set-output name=branch::${{ needs.update_versions.outputs.new_branch }}"
117140
fi
118141
119142
build_android:
120-
name: build-android-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
143+
name: build-android-unity${{ needs.check_and_prepare.outputs.unity_version }}-CPP${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
121144
uses: ./.github/workflows/build_android.yml
122145
needs: [check_and_prepare, decide_build_branch]
123146
if: always() && contains(needs.check_and_prepare.outputs.platform, 'Android')
124147
with:
125-
unity_version: ${{ github.event.inputs.unity_version }}
126-
firebase_cpp_sdk_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
148+
unity_version: ${{ needs.check_and_prepare.outputs.unity_version }}
149+
firebase_cpp_sdk_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
127150
unity_branch: ${{ needs.decide_build_branch.outputs.build_branch }}
128-
apis: ${{ github.event.inputs.apis }}
151+
apis: ${{ needs.check_and_prepare.outputs.apis }}
129152
unity_platform_name: Android
130-
additional_cmake_flags: ${{ github.event.inputs.additional_cmake_flags }}
153+
additional_cmake_flags: ${{ needs.check_and_prepare.outputs.additional_cmake_flags }}
131154

132155
build_ios:
133-
name: build-ios-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
156+
name: build-ios-unity${{ needs.check_and_prepare.outputs.unity_version }}-CPP${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
134157
uses: ./.github/workflows/build_ios.yml
135158
needs: [check_and_prepare, decide_build_branch]
136159
if: always() && contains(needs.check_and_prepare.outputs.platform, 'iOS')
137160
with:
138-
unity_version: ${{ github.event.inputs.unity_version }}
139-
firebase_cpp_sdk_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
161+
unity_version: ${{needs.check_and_prepare.outputs.unity_version }}
162+
firebase_cpp_sdk_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
140163
unity_branch: ${{ needs.decide_build_branch.outputs.build_branch }}
141-
apis: ${{ github.event.inputs.apis }}
164+
apis: ${{ needs.check_and_prepare.outputs.apis }}
142165
unity_platform_name: iOS
143-
additional_cmake_flags: ${{ github.event.inputs.additional_cmake_flags }}
166+
additional_cmake_flags: ${{ needs.check_and_prepare.outputs.additional_cmake_flags }}
144167

145168
build_linux:
146-
name: build-linux-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
169+
name: build-linux-unity${{ needs.check_and_prepare.outputs.unity_version }}-CPP${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
147170
uses: ./.github/workflows/build_linux.yml
148171
needs: [check_and_prepare, decide_build_branch]
149172
if: always() && contains(needs.check_and_prepare.outputs.platform, 'Linux')
150173
with:
151-
unity_version: ${{ github.event.inputs.unity_version }}
152-
firebase_cpp_sdk_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
174+
unity_version: ${{ needs.check_and_prepare.outputs.unity_version }}
175+
firebase_cpp_sdk_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
153176
unity_branch: ${{ needs.decide_build_branch.outputs.build_branch }}
154-
apis: ${{ github.event.inputs.apis }}
177+
apis: ${{ needs.check_and_prepare.outputs.apis }}
155178
unity_platform_name: Linux
156-
additional_cmake_flags: ${{ github.event.inputs.additional_cmake_flags }}
179+
additional_cmake_flags: ${{ needs.check_and_prepare.outputs.additional_cmake_flags }}
157180

158181
build_macos:
159-
name: build-macos-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
182+
name: build-macos-unity${{ needs.check_and_prepare.outputs.unity_version }}-CPP${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
160183
uses: ./.github/workflows/build_macos.yml
161184
needs: [check_and_prepare, decide_build_branch]
162185
if: always() && contains(needs.check_and_prepare.outputs.platform, 'macOS')
163186
with:
164-
unity_version: ${{ github.event.inputs.unity_version }}
165-
firebase_cpp_sdk_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
166-
unity_branch: ${{ github.event.inputs.unity_branch }}
167-
apis: ${{ github.event.inputs.apis }}
187+
unity_version: ${{ needs.check_and_prepare.outputs.unity_version }}
188+
firebase_cpp_sdk_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
189+
unity_branch: ${{ needs.check_and_prepare.outputs.unity_branch }}
190+
apis: ${{ needs.check_and_prepare.outputs.apis }}
168191
unity_platform_name: macOS,iOS
169-
additional_cmake_flags: ${{ github.event.inputs.additional_cmake_flags }}
192+
additional_cmake_flags: ${{ needs.check_and_prepare.outputs.additional_cmake_flags }}
170193

171194
build_windows:
172-
name: build-windows-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
195+
name: build-windows-unity${{ needs.check_and_prepare.outputs.unity_version }}-CPP${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
173196
uses: ./.github/workflows/build_windows.yml
174197
needs: [check_and_prepare, decide_build_branch]
175198
if: always() && contains(needs.check_and_prepare.outputs.platform, 'Windows')
176199
with:
177-
unity_version: ${{ github.event.inputs.unity_version }}
178-
firebase_cpp_sdk_version: ${{ github.event.inputs.firebase_cpp_sdk_version }}
200+
unity_version: ${{ needs.check_and_prepare.outputs.unity_version }}
201+
firebase_cpp_sdk_version: ${{ needs.check_and_prepare.outputs.firebase_cpp_sdk_version }}
179202
unity_branch: ${{ needs.decide_build_branch.outputs.build_branch }}
180-
apis: ${{ github.event.inputs.apis }}
203+
apis: ${{ needs.check_and_prepare.outputs.apis }}
181204
unity_platform_name: Windows
182-
additional_cmake_flags: ${{ github.event.inputs.additional_cmake_flags }}
205+
additional_cmake_flags: ${{ needs.check_and_prepare.outputs.additional_cmake_flags }}
183206

184207
trigger_reusable_package:
185208
name: package ${{ needs.check_and_prepare.outputs.release_label }}
186209
needs: [build_android, build_ios, build_linux, build_macos, build_windows, decide_build_branch]
187210
uses: ./.github/workflows/package.yml
188-
if: (github.event.inputs.should_trigger_package == 'true') && !cancelled() && !failure()
211+
if: (needs.check_and_prepare.outputs.should_trigger_package == 'true') && !cancelled() && !failure()
189212
with:
190213
triggered_by_callable: true
191214
release_label: ${{ needs.check_and_prepare.outputs.release_label }}
192-
skipIntegrationTests: ${{ github.event.inputs.skipIntegrationTests }}
215+
skipIntegrationTests: ${{ needs.check_and_prepare.outputs.skipIntegrationTests }}
193216
build_run_id: ${{ github.run_id }}
194217
working_branch: ${{ needs.decide_build_branch.outputs.build_branch }}
195218
secrets: inherit

.github/workflows/build_windows.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ jobs:
119119
# TODO add handling cmake_extras
120120
python scripts/build_scripts/build_zips.py --platform=windows --unity_root="$UNITY_ROOT_DIR" --swig_dir="$SWIG_DIR" --apis=${{ inputs.apis }}
121121
122+
- name: Check zip file
123+
shell: bash
124+
run: |
125+
if [ -f windows_unity/*.zip ]; then
126+
echo "windows_unity zip created."
127+
else
128+
echo "Fail to create windows_unity zip."
129+
exit 1
130+
fi
131+
122132
- name: Upload Build
123133
uses: actions/upload-artifact@v2
124134
with:

0 commit comments

Comments
 (0)