|
| 1 | +# Workflow to generate the SWIG files on linux |
| 2 | +name: Generate SWIG files |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + unity_version: |
| 8 | + description: 'Unity version' |
| 9 | + default: '2020' |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + firebase_cpp_sdk_version: |
| 13 | + description: 'Firebase CPP SDK version to build against (The branch, tag or SHA to checkout)' |
| 14 | + default: '' |
| 15 | + required: false |
| 16 | + type: string |
| 17 | + unity_branch: |
| 18 | + description: 'Unity branch to build against, empty means current branch' |
| 19 | + default: '' |
| 20 | + type: string |
| 21 | + apis: |
| 22 | + description: 'CSV of apis to build and test' |
| 23 | + default: 'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage' |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + unity_platform_name: |
| 27 | + description: 'The platform name Unity should install with' |
| 28 | + default: '' |
| 29 | + required: true |
| 30 | + type: string |
| 31 | + # Additional CMake flags to use |
| 32 | + additional_cmake_flags: |
| 33 | + description: 'Additional flags to pass into CMake' |
| 34 | + default: '' |
| 35 | + required: false |
| 36 | + type: string |
| 37 | + |
| 38 | +jobs: |
| 39 | + generate_swig: |
| 40 | + name: generate-swig-unity${{inputs.unity_version}}-CPP${{ inputs.firebase_cpp_sdk_version }} |
| 41 | + runs-on: ubuntu-20.04 |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v3 |
| 47 | + with: |
| 48 | + submodules: true |
| 49 | + ref: ${{ inputs.unity_branch }} |
| 50 | + |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + with: |
| 53 | + repository: firebase/firebase-cpp-sdk |
| 54 | + path: firebase-cpp-sdk |
| 55 | + submodules: true |
| 56 | + ref: ${{ inputs.firebase_cpp_sdk_version }} |
| 57 | + |
| 58 | + - name: Setup python |
| 59 | + uses: actions/setup-python@v4 |
| 60 | + with: |
| 61 | + python-version: '3.7' |
| 62 | + |
| 63 | + - name: Install prerequisites |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + echo "FIREBASE_CPP_SDK_DIR=${{ github.workspace }}/firebase-cpp-sdk" >> $GITHUB_ENV |
| 67 | + cd firebase-cpp-sdk |
| 68 | + python scripts/gha/install_prereqs_desktop.py |
| 69 | + cd .. |
| 70 | +
|
| 71 | + - name: Install python deps |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + pip install -r scripts/gha/requirements.txt |
| 75 | +
|
| 76 | + - name: Install OpenSSL (Linux) |
| 77 | + run: | |
| 78 | + sudo apt install openssl |
| 79 | +
|
| 80 | + - id: unity_setup |
| 81 | + uses: ./gha/unity |
| 82 | + timeout-minutes: 30 |
| 83 | + with: |
| 84 | + version: ${{ inputs.unity_version }} |
| 85 | + platforms: ${{ inputs.unity_platform_name }} |
| 86 | + |
| 87 | + - name: Setup Swig Env |
| 88 | + shell: bash |
| 89 | + run: | |
| 90 | + echo "$(swig -swiglib)" >> $GITHUB_PATH |
| 91 | + swig -swiglib |
| 92 | + echo "SWIG_DIR=$(swig -swiglib)" >> $GITHUB_ENV |
| 93 | +
|
| 94 | + - name: Build SDK (Linux) |
| 95 | + timeout-minutes: 90 |
| 96 | + shell: bash |
| 97 | + run: | |
| 98 | + # TODO add handling cmake_extras |
| 99 | + python scripts/build_scripts/build_zips.py --gha --platform=linux --use_boringssl=true --unity_root=$UNITY_ROOT_DIR --apis=${{ inputs.apis }} --gen_documentation_zip |
| 100 | + |
| 101 | + - name: Check zip files |
| 102 | + shell: bash |
| 103 | + run: | |
| 104 | + if [ -f linux_unity/*Linux.zip ]; then |
| 105 | + echo "linux_unity zip created." |
| 106 | + else |
| 107 | + echo "Fail to create linux_unity zip." |
| 108 | + exit 1 |
| 109 | + fi |
| 110 | + if [ -f linux_unity/documentation_sources.zip ]; then |
| 111 | + echo "documentation_sources zip created." |
| 112 | + else |
| 113 | + echo "Fail to create documentation_sources zip." |
| 114 | + exit 1 |
| 115 | + fi |
| 116 | +
|
| 117 | + - name: Upload Build |
| 118 | + uses: actions/upload-artifact@v3 |
| 119 | + with: |
| 120 | + name: linux_unity |
| 121 | + path: linux_unity/*Linux.zip |
| 122 | + |
| 123 | + - name: Upload Documentation Sources |
| 124 | + uses: actions/upload-artifact@v3 |
| 125 | + with: |
| 126 | + name: documentation_sources |
| 127 | + path: linux_unity/documentation_sources.zip |
0 commit comments