Skip to content

Commit 12162cc

Browse files
cynthiajoanCynthia Jiang
andauthored
Initial setup for starter and reuse workflow (#307)
* revert boringssl for linux/windows for now * update unity linux version * initial setup for the build starter and reusable gha * end file extra line * fix end line again * and again * fix the use call, which cannot pass in matrix value * remove env that's not needed anymore Co-authored-by: Cynthia Jiang <[email protected]>
1 parent f9fc910 commit 12162cc

File tree

6 files changed

+693
-0
lines changed

6 files changed

+693
-0
lines changed

.github/workflows/build_android.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Workflow to handle building the Unity SDK on android
2+
name: Build Android Reuse
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
unity_version:
8+
description: 'Unity version'
9+
default: '2019'
10+
required: true
11+
firebase_cpp_sdk_version:
12+
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'
13+
default: ''
14+
required: false
15+
unity_branch:
16+
description: 'Unity branch to build against, empty means current branch'
17+
default: ''
18+
apis:
19+
description: 'CSV of apis to build and test'
20+
default: 'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'
21+
required: true
22+
unity_platform_name:
23+
description: 'The platform name Unity should install with'
24+
default: ''
25+
required: true
26+
# Additional CMake flags to use
27+
additional_cmake_flags:
28+
description: 'Additional flags to pass into CMake'
29+
default: ''
30+
required: false
31+
32+
jobs:
33+
build_android:
34+
name: build-android-macos-unity${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
35+
runs-on: macos-latest
36+
strategy:
37+
fail-fast: false
38+
env:
39+
# LC_ALL, LANG and U3D_PASSWORD are needed for U3D.
40+
LC_ALL: en_US.UTF-8
41+
LANG: en_US.UTF-8
42+
U3D_PASSWORD: ""
43+
# Disable checking for U3D updates, since it is buggy
44+
U3D_SKIP_UPDATE_CHECK: 1
45+
CCACHE_DIR: ${{ github.workspace }}/ccache_dir
46+
47+
steps:
48+
- name: Checkout Unity Repo
49+
uses: actions/checkout@v2
50+
with:
51+
submodules: true
52+
ref: ${{ github.event.inputs.unity_branch }}
53+
54+
- name: Checkout CPP Repo
55+
uses: actions/checkout@v2
56+
with:
57+
repository: firebase/firebase-cpp-sdk
58+
path: firebase-cpp-sdk
59+
ref: ${{ github.event.inputs.firebase_cpp_sdk_version }}
60+
submodules: true
61+
62+
- uses: ruby/setup-ruby@v1
63+
with:
64+
ruby-version: 2.6
65+
66+
- name: Setup python
67+
uses: actions/setup-python@v2
68+
with:
69+
python-version: '3.7'
70+
71+
- name: Install prerequisites
72+
shell: bash
73+
run: |
74+
echo "FIREBASE_CPP_SDK_DIR=${{ github.workspace }}/firebase-cpp-sdk" >> $GITHUB_ENV
75+
cd firebase-cpp-sdk
76+
python scripts/gha/install_prereqs_desktop.py
77+
build_scripts/android/install_prereqs.sh
78+
cd ..
79+
80+
- name: Cache NDK
81+
id: cache_ndk
82+
uses: actions/cache@v2
83+
with:
84+
path: /tmp/android-ndk-r16b
85+
key: android-ndk-${{ matrix.os }}-r16b
86+
87+
- name: Install Unity installer (U3D)
88+
shell: bash
89+
run: gem install u3d -v 1.2.3
90+
91+
- name: Install python deps
92+
shell: bash
93+
run: |
94+
pip install -r scripts/gha/requirements.txt
95+
96+
- name: Install Unity
97+
shell: bash
98+
run: |
99+
python scripts/gha/unity_installer.py --install --platforms ${{ github.event.inputs.unity_platform_name }} --version ${{ github.event.inputs.unity_version }}
100+
101+
- name: Setup Unity path
102+
shell: bash
103+
run: |
104+
echo "UNITY_ROOT_DIR=$( python scripts/gha/print_matrix_configuration.py -u ${{ github.event.inputs.unity_version }} -k unity_path )" >> $GITHUB_ENV
105+
106+
- name: Display Swig Version
107+
shell: bash
108+
run: |
109+
swig -version
110+
111+
- name: Build SDK (Android)
112+
shell: bash
113+
run: |
114+
python scripts/build_scripts/build_zips.py --platform=android --unity_root=$UNITY_ROOT_DIR --extra_cmakes=${{ github.event.inputs.additional_cmake_flags }}
115+
116+
- name: Upload Build
117+
uses: actions/upload-artifact@v2
118+
with:
119+
name: android_unity
120+
path: android_unity/*.zip

.github/workflows/build_ios.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Workflow to handle building the Unity SDK on iOS
2+
name: Build iOS Reuse
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
unity_version:
8+
description: 'Unity version'
9+
default: '2019'
10+
required: true
11+
firebase_cpp_sdk_version:
12+
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'
13+
default: ''
14+
required: false
15+
unity_branch:
16+
description: 'Unity branch to build against, empty means current branch'
17+
default: ''
18+
apis:
19+
description: 'CSV of apis to build and test'
20+
default: 'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'
21+
required: true
22+
unity_platform_name:
23+
description: 'The platform name Unity should install with'
24+
default: ''
25+
required: true
26+
# Additional CMake flags to use
27+
additional_cmake_flags:
28+
description: 'Additional flags to pass into CMake'
29+
default: ''
30+
required: false
31+
32+
jobs:
33+
build_ios:
34+
name: build-ios-macos-${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
35+
runs-on: macos-12
36+
strategy:
37+
fail-fast: false
38+
39+
env:
40+
# LC_ALL, LANG and U3D_PASSWORD are needed for U3D.
41+
LC_ALL: en_US.UTF-8
42+
LANG: en_US.UTF-8
43+
U3D_PASSWORD: ""
44+
# Disable checking for U3D updates, since it is buggy
45+
U3D_SKIP_UPDATE_CHECK: 1
46+
xcodeVersion: "13.3.1"
47+
48+
steps:
49+
- name: Checkout Unity Repo
50+
uses: actions/checkout@v2
51+
with:
52+
submodules: true
53+
ref: ${{ github.event.inputs.unity_branch }}
54+
55+
- name: Checkout CPP Repo
56+
uses: actions/checkout@v2
57+
with:
58+
repository: firebase/firebase-cpp-sdk
59+
path: firebase-cpp-sdk
60+
ref: ${{ github.event.inputs.firebase_cpp_sdk_version }}
61+
submodules: true
62+
63+
- name: Setup python
64+
uses: actions/setup-python@v2
65+
with:
66+
python-version: '3.7'
67+
68+
- name: setup Xcode version
69+
run: sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
70+
71+
- name: Install prerequisites
72+
shell: bash
73+
run: |
74+
echo "FIREBASE_CPP_SDK_DIR=${{ github.workspace }}/firebase-cpp-sdk" >> $GITHUB_ENV
75+
cd firebase-cpp-sdk
76+
python scripts/gha/install_prereqs_desktop.py
77+
cd ..
78+
79+
- name: Install Unity installer (U3D)
80+
shell: bash
81+
run: gem install u3d -v 1.2.3
82+
83+
- name: Install python deps
84+
shell: bash
85+
run: |
86+
pip install -r scripts/gha/requirements.txt
87+
88+
- name: Install Unity
89+
shell: bash
90+
run: |
91+
python scripts/gha/unity_installer.py --install --platforms ${{ github.event.inputs.unity_platform_name }} --version ${{ github.event.inputs.unity_version }}
92+
93+
- name: Setup Unity path
94+
shell: bash
95+
run: |
96+
echo "UNITY_ROOT_DIR=$( python scripts/gha/print_matrix_configuration.py -u ${{ github.event.inputs.unity_version }} -k unity_path )" >> $GITHUB_ENV
97+
98+
- name: Build SDK (iOS)
99+
shell: bash
100+
run: |
101+
python scripts/build_scripts/build_zips.py --platform=iOS --unity_root=$UNITY_ROOT_DIR --extra_cmakes=${{ github.event.inputs.additional_cmake_flags }}
102+
103+
- name: Upload Build
104+
uses: actions/upload-artifact@v2
105+
with:
106+
name: ios_unity
107+
path: ios_unity/*.zip

.github/workflows/build_linux.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Workflow to handle building the Unity SDK on linux
2+
name: Build linux Reuse
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
unity_version:
8+
description: 'Unity version'
9+
default: '2019'
10+
required: true
11+
firebase_cpp_sdk_version:
12+
description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)'
13+
default: ''
14+
required: false
15+
unity_branch:
16+
description: 'Unity branch to build against, empty means current branch'
17+
default: ''
18+
apis:
19+
description: 'CSV of apis to build and test'
20+
default: 'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'
21+
required: true
22+
unity_platform_name:
23+
description: 'The platform name Unity should install with'
24+
default: ''
25+
required: true
26+
# Additional CMake flags to use
27+
additional_cmake_flags:
28+
description: 'Additional flags to pass into CMake'
29+
default: ''
30+
required: false
31+
32+
jobs:
33+
build_desktop:
34+
name: build-desktop-linux-${{matrix.unity_version}}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
35+
runs-on: ubuntu-latest
36+
strategy:
37+
fail-fast: false
38+
39+
env:
40+
# LC_ALL, LANG and U3D_PASSWORD are needed for U3D.
41+
LC_ALL: en_US.UTF-8
42+
LANG: en_US.UTF-8
43+
U3D_PASSWORD: ""
44+
# Disable checking for U3D updates, since it is buggy
45+
U3D_SKIP_UPDATE_CHECK: 1
46+
steps:
47+
- uses: actions/checkout@v2
48+
with:
49+
submodules: true
50+
ref: ${{ github.event.inputs.unity_branch }}
51+
52+
- uses: actions/checkout@v2
53+
with:
54+
repository: firebase/firebase-cpp-sdk
55+
path: firebase-cpp-sdk
56+
submodules: true
57+
ref: ${{ github.event.inputs.firebase_cpp_sdk_version }}
58+
59+
# Set up the requirements, and install Unity
60+
# Ruby setup has to happen before python install and setup, to keep the absl config.
61+
- uses: ruby/setup-ruby@v1
62+
with:
63+
ruby-version: 3.0.2
64+
65+
- name: Install Unity installer (U3D)
66+
shell: bash
67+
run: gem install u3d -v 1.2.3
68+
69+
- name: Setup python
70+
uses: actions/setup-python@v2
71+
with:
72+
python-version: '3.7'
73+
74+
- name: Install prerequisites
75+
shell: bash
76+
run: |
77+
echo "FIREBASE_CPP_SDK_DIR=${{ github.workspace }}/firebase-cpp-sdk" >> $GITHUB_ENV
78+
cd firebase-cpp-sdk
79+
python scripts/gha/install_prereqs_desktop.py
80+
cd ..
81+
82+
- name: Install python deps
83+
shell: bash
84+
run: |
85+
pip install -r scripts/gha/requirements.txt
86+
87+
- name: Install OpenSSL (Linux)
88+
run: |
89+
sudo apt install openssl
90+
91+
- name: Install Unity
92+
shell: bash
93+
run: |
94+
python scripts/gha/unity_installer.py --install --platforms ${{ github.event.inputs.unity_platform_name }} --version ${{ matrix.unity_version }}
95+
96+
- name: Setup Unity path
97+
shell: bash
98+
run: |
99+
echo "UNITY_ROOT_DIR=$( python scripts/gha/print_matrix_configuration.py -u ${{matrix.unity_version}} -k unity_path )" >> $GITHUB_ENV
100+
echo "$(swig -swiglib)" >> $GITHUB_PATH
101+
swig -swiglib
102+
echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV
103+
104+
- name: Build SDK (Linux)
105+
shell: bash
106+
run: |
107+
python scripts/build_scripts/build_zips.py --platform=linux --use_boringssl=true --unity_root=$UNITY_ROOT_DIR --extra_cmakes=${{ github.event.inputs.additional_cmake_flags }}
108+
109+
- name: Upload Build
110+
uses: actions/upload-artifact@v2
111+
with:
112+
name: linux_unity
113+
path: linux_unity/*.zip

0 commit comments

Comments
 (0)