Skip to content

Fix the package logic, and add windows build python logic #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b3a25bb
calculate hash for tgzs
Apr 21, 2022
86259d0
don't need basename
Apr 21, 2022
ecc8051
append hash instead of over write
Apr 21, 2022
8b6330d
correct the location
Apr 21, 2022
19f001b
make warning message clear
Apr 21, 2022
f475507
Merge https://github.com/firebase/firebase-unity-sdk into prepare_tgz
Apr 22, 2022
ec25028
ping to cpp latest release
Apr 22, 2022
b07269a
sync up the name
Apr 22, 2022
707172c
try multi arg
Apr 22, 2022
f55878b
test another tag
Apr 22, 2022
f0416e6
try again
Apr 22, 2022
4dd980d
remove unused
Apr 22, 2022
5ea1f55
clean up issue
Apr 22, 2022
50db037
fix unity 2019 linux version
Apr 22, 2022
d542c61
Merge https://github.com/firebase/firebase-unity-sdk into prepare_tgz
Apr 22, 2022
4581ad9
test windows command
Apr 22, 2022
eb2a6d1
Merge https://github.com/firebase/firebase-unity-sdk into prepare_tgz
Apr 22, 2022
459299f
add build target to desktop workflow
Apr 22, 2022
d7da3c1
update python executable path
cynthiajoan Apr 22, 2022
ae0098d
try again with contain test
Apr 22, 2022
a718036
Merge branch 'prepare_tgz' of https://github.com/firebase/firebase-un…
Apr 22, 2022
2ba0eac
contains test
Apr 22, 2022
22bc9f1
put windows in the right logic
Apr 22, 2022
7646cbd
test windows using python script
Apr 22, 2022
226ce17
try again
Apr 22, 2022
3b28318
try only build dotnet4
Apr 23, 2022
e46e155
try to reduce the android sdk size
Apr 23, 2022
d41a33b
Merge https://github.com/firebase/firebase-unity-sdk into prepare_tgz
Apr 23, 2022
675b5b1
test android size
Apr 23, 2022
10caeeb
Merge https://github.com/firebase/firebase-unity-sdk into prepare_tgz
Apr 28, 2022
c0760d8
add output folder to ignore
Apr 28, 2022
6f0ef21
try some package.yml fix
Apr 28, 2022
7a6bcce
more print out
Apr 28, 2022
11b79f3
try to fix the syntax
Apr 28, 2022
35f71cb
invalid symbol fix
Apr 28, 2022
90a1011
Test new branch
Apr 28, 2022
37d7d76
more package workflow fix
Apr 28, 2022
9867a44
try again for desktop pick platform
Apr 28, 2022
ff60d7a
try windows build
Apr 28, 2022
96f2f5d
revert unnecessary files
Apr 29, 2022
ff9bbf8
fix
Apr 29, 2022
0397ff5
add cpp tag version to build job names
Apr 29, 2022
03a1ebf
Add release label for package
Apr 29, 2022
ccd0a59
review feedback
Apr 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:

jobs:
build_android:
name: build-android-macos-${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
runs-on: macos-latest
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:

jobs:
build_ios:
name: build-ios-macos-${{ github.event.inputs.unity_version }}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
runs-on: macos-latest
strategy:
fail-fast: false
Expand Down
48 changes: 38 additions & 10 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,34 @@ on:
skipIntegrationTests:
description: 'skip integration tests?'
default: 0
required: false
create_new_branch:
description: 'If we need to create new branch to package guids update. 0 means no creation and 1 means create. If working_branch set, will ignore this value. '
default: 0
required: false
working_branch:
description: 'If already a working in progress release branch'
default: None
required: false
download_ios_run:
description: 'run id for ios.yml'
required: false
download_android_run:
description: 'run id for android.yml'
required: false
download_desktop_run:
description: 'run id for sdk_build.yml'
required: false
release_label:
description: 'If the package is intended to run for a release, put <version>-RC## for label'
required: false

env:
# Use SHA256 for hashing files.
hashCommand: "sha256sum"

jobs:
package_sdks:
name: package-${{matrix.os}}
name: package-${{matrix.os}}-${{github.event.inputs.release_label}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
Expand All @@ -31,6 +48,17 @@ jobs:
- os: ubuntu-latest
package_dir: output
steps:
- name: Print out inputs
shell: bash
run: |
echo operation_system: ${{ github.event.inputs.operating_systems }}
echo skipIntegrationTests: ${{ github.event.inputs.skipIntegrationTests }}
echo create_new_branch: ${{ github.event.inputs.create_new_branch }}
echo working_branch: ${{ github.event.inputs.working_branch }}
echo download_ios_run: ${{ github.event.inputs.download_ios_run }}
echo download_android_run: ${{ github.event.inputs.download_android_run }}
echo download_desktop_run: ${{ github.event.inputs.download_desktop_run }}

- name: Check out base branch
uses: actions/[email protected]
with:
Expand All @@ -55,20 +83,20 @@ jobs:
pip install -r scripts/gha/requirements.txt

- name: Name new branch
if: github.event.inputs.working_branch == 'None'
if: github.event.inputs.working_branch == '' && github.event.inputs.create_new_branch == '1'
run: |
date_str=$(date "+%Y%m%d-%H%M%S")
echo "NEW_BRANCH=${{env.branchPrefix}}${{github.event.inputs.package_version_number}}-${date_str}" >> $GITHUB_ENV
echo "NEW_BRANCH=new_branch-${date_str}" >> $GITHUB_ENV

- name: Create new branch
if: github.event.inputs.working_branch == 'None'
if: github.event.inputs.working_branch == '' && github.event.inputs.create_new_branch == '1'
run: |
git remote update
git checkout -b "${NEW_BRANCH}"
echo "UPDATE_LOGFILE=update_log.txt" >> $GITHUB_ENV

- name: Checkout working branch
if: github.event.inputs.working_branch != 'None'
if: github.event.inputs.working_branch != ''
run: |
git remote update
git checkout ${{ github.event.inputs.working_branch }}
Expand All @@ -80,21 +108,21 @@ jobs:
uses: dawidd6/action-download-artifact@v2
with:
workflow: 'sdk_build.yml'
run_id: ${{ github.event.inputs.downloadPreviousRun }}
run_id: ${{ github.event.inputs.download_desktop_run }}
path: built_artifect

- name: Fetch iOS Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: 'ios.yml'
run_id: ${{ github.event.inputs.downloadPreviousRun }}
run_id: ${{ github.event.inputs.download_ios_run }}
path: built_artifect

- name: Fetch Android Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: 'android.yml'
run_id: ${{ github.event.inputs.downloadPreviousRun }}
run_id: ${{ github.event.inputs.download_android_run }}
path: built_artifect

- name: move zip files
Expand Down Expand Up @@ -129,7 +157,7 @@ jobs:
fi

- name: Create PR if there is None
if: github.event.inputs.working_branch == 'None'
if: github.event.inputs.working_branch == '' && github.event.inputs.create_new_branch == '1'
id: push-branch
run: |
if ! git update-index --refresh; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

jobs:
build_desktop:
name: build-desktop-${{matrix.os}}-${{matrix.unity_version}}
name: build-desktop-${{matrix.os}}-${{matrix.unity_version}}-CPP${{ github.event.inputs.firebase_cpp_sdk_version }}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ gcs_key_file.json
*_unity/
*_unity_seperate/
*_unity_separate/
output/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other separate was intentional (different spellings, with the a one being the correct one)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, was confused a lot, now totally make sense...

output_unpack*/

# Windows ignore
vcpkg
Expand Down
1 change: 1 addition & 0 deletions cmake/build_shared.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function(build_firebase_shared LIBRARY_NAME ARTIFACT_NAME OUTPUT_NAME)
set_target_properties(${shared_target}
PROPERTIES
PREFIX "lib"
# SUFFIX default is ".so"
)
else()
set_target_properties(${shared_target}
Expand Down
22 changes: 22 additions & 0 deletions scripts/build_scripts/build_zips.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import subprocess
import zipfile
import tempfile
import sys

from absl import app, flags, logging

Expand Down Expand Up @@ -270,6 +271,7 @@ def get_android_args():
result_args.append("-DFIREBASE_ANDROID_BUILD=true")
# android default to build release.
result_args.append("-DCMAKE_BUILD_TYPE=release")
result_args.append("-DANDROID_STL=c++_shared")
return result_args


Expand Down Expand Up @@ -350,6 +352,17 @@ def make_android_multi_arch_build(cmake_args, merge_script):
logging.info("Generated Android multi-arch (%s) zip %s",
",".join(g_mobile_target_architectures), final_zip_path)

def get_windows_args():
"""Get the cmake args for windows platform specific.

Returns:
camke args for windows platform.
"""
result_args = []
result_args.append('-G \"Visual Studio 16 2019\"')
result_args.append('-A x64') # TODO flexibily for x32
result_args.append("-DFIREBASE_PYTHON_HOST_EXECUTABLE:FILEPATH=%s" % sys.executable)
return result_args

def is_android_build():
"""
Expand All @@ -366,6 +379,13 @@ def is_ios_build():
"""
return FLAGS.platform == "ios"

def is_windows_build():
"""
Returns:
If the build platform is windows
"""
return FLAGS.platform == "windows"


def main(argv):
if len(argv) > 1:
Expand Down Expand Up @@ -411,6 +431,8 @@ def main(argv):
cmake_setup_args.extend(get_ios_args(source_path))
elif is_android_build():
cmake_setup_args.extend(get_android_args())
elif is_windows_build():
cmake_setup_args.extend(get_windows_args())

global g_mobile_target_architectures
logging.info("cmake_setup_args is: " + " ".join(cmake_setup_args))
Expand Down