updated editor version #2419
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Automatic build | |
| on: [push, pull_request] | |
| jobs: | |
| # To setup secrets for client build, see https://game.ci/docs/github/activation | |
| # NOTE: For personal license, a dedicated account is recommended | |
| # NOTE: To generate the license file, open Unity 2018 on a project at least once | |
| check-secret: | |
| name: Check if secrets available | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| outputs: | |
| secret-is-set: ${{ steps.secret-is-set.outputs.defined }} | |
| steps: | |
| - name: Check if secret is set, then set variable | |
| id: secret-is-set | |
| env: | |
| TMP_SECRET1: ${{ secrets.UNITY_LICENSE }} | |
| TMP_SECRET2: ${{ secrets.UNITY_EMAIL }} | |
| TMP_SECRET3: ${{ secrets.UNITY_PASSWORD }} | |
| if: "${{ env.TMP_SECRET1 != '' && env.TMP_SECRET2 != '' && env.TMP_SECRET3 != '' }}" | |
| run: echo "defined=true" >> $GITHUB_OUTPUT | |
| build-client: | |
| name: Build client for ${{ matrix.targetPlatform }} | |
| timeout-minutes: 100 | |
| runs-on: ${{ matrix.buildPlatform }} | |
| permissions: | |
| actions: write # to allow us to manage cache | |
| env: | |
| projectPath: Basis | |
| buildName: Basis Unity | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| targetPlatform: | |
| - StandaloneLinux64 | |
| - Android | |
| buildPlatform: | |
| - ubuntu-latest | |
| include: | |
| - buildPlatform: windows-2022 | |
| targetPlatform: StandaloneWindows64 | |
| needs: [check-secret] | |
| if: needs.check-secret.outputs.secret-is-set == 'true' | |
| steps: | |
| # We're running out of disk space in some cases. However, the actual build is happening in a docker container. | |
| # Therefore, we don't actually need most of the tools that github provides. This can save quite a bit of space. | |
| # Also consider https://github.com/easimon/maximize-build-space/, which pulls some other tricks. | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@main | |
| if: matrix.buildPlatform == 'ubuntu-latest' | |
| with: | |
| tool-cache: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: false | |
| swap-storage: false | |
| - name: "Checkout repository" | |
| timeout-minutes: 5 | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Restore Library cache" | |
| id: restore-cache | |
| timeout-minutes: 10 | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: ${{ env.projectPath }}/Library | |
| key: Library-${{ env.projectPath }}-${{ matrix.targetPlatform }}-${{ hashFiles(env.projectPath) }} | |
| restore-keys: Library-${{ env.projectPath }}-${{ matrix.targetPlatform }}- | |
| - name: "Create version string" | |
| id: version | |
| run: echo "gitversion=$(git describe --tags --always)" >> "$GITHUB_OUTPUT" | |
| - name: "Remove OpenXR when building for Linux" | |
| if: matrix.targetPlatform == 'StandaloneLinux64' | |
| run: jq 'del(.dependencies ["com.unity.xr.openxr"])' < ${projectPath}/Packages/manifest.json > manifest.json.tmp && mv manifest.json.tmp ${projectPath}/Packages/manifest.json | |
| - name: "Remove Meta XR Core when building for Linux" | |
| if: matrix.targetPlatform == 'StandaloneLinux64' | |
| run: rm -rf ${projectPath}/Packages/com.meta.xr.sdk.core | |
| - name: "Build Unity project" | |
| timeout-minutes: 100 | |
| uses: kitlith/unity-builder@linux-extension | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| buildName: ${{ env.buildName }} | |
| projectPath: ${{ env.projectPath }} | |
| targetPlatform: ${{ matrix.targetPlatform }} | |
| versioning: Custom | |
| version: ${{ steps.version.outputs.gitversion }} | |
| # TODO: make a decision on how we want to increment this. | |
| # This number was chosen to be slightly larger than the version code used for 0.056B. | |
| androidVersionCode: 55 | |
| androidExportType: androidPackage | |
| androidKeystoreName: BasisQuest # This file won't exist, but this property needs to exist. | |
| androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} | |
| androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} | |
| androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} | |
| linux64RemoveExecutableExtension: false | |
| - name: "Save Library Cache" | |
| uses: actions/cache/save@v3 | |
| if: always() && github.ref_name == 'developer' | |
| with: | |
| path: ${{ env.projectPath }}/Library | |
| key: ${{ steps.restore-cache.outputs.cache-primary-key }} | |
| - name: "Only retain latest cache" | |
| if: always() && github.ref_name == 'developer' | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| OLD_CACHE_IDS=$(gh cache list --sort created_at --key Library-${{ env.projectPath }}-${{ matrix.targetPlatform }}- --json id --jq '.[1:] | map(.id) | @sh') | |
| for cache_id in $OLD_CACHE_IDS; do | |
| echo "Deleting cache id: $cache_id" | |
| gh cache delete $cache_id | |
| done | |
| - name: "Upload client artifact" | |
| timeout-minutes: 2 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Basis-Client-${{ matrix.targetPlatform }} | |
| path: | | |
| build/${{ matrix.targetPlatform }} | |
| !build/${{ matrix.targetPlatform }}/${{ env.buildName }}_BackUpThisFolder_ButDontShipItWithYourGame | |
| - name: "Upload client symbols artifact" | |
| timeout-minutes: 4 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Basis-Symbols-Client-${{ matrix.targetPlatform }} | |
| path: | | |
| build/${{ matrix.targetPlatform }}/${{ env.buildName }}_BackUpThisFolder_ButDontShipItWithYourGame | |
| - name: Archive symbols | |
| uses: thedoctor0/[email protected] | |
| if: github.ref_type == 'tag' && matrix.targetPlatform != 'Android' | |
| with: | |
| type: "zip" | |
| directory: build/${{ matrix.targetPlatform }} | |
| filename: "${{ github.workspace }}/Basis Unity ${{ matrix.targetPlatform }} Symbols.zip" | |
| # This uses a wildcard because this action doesn't work correctly with spaces in path. | |
| path: "*_BackUpThisFolder_ButDontShipItWithYourGame" | |
| # workaround for exclusions not working with spaces *or* wildcards. | |
| - name: Delete symbols | |
| if: github.ref_type == 'tag' && matrix.targetPlatform != 'Android' | |
| shell: bash | |
| run: > | |
| ${{ matrix.buildPlatform == 'ubuntu-latest' && 'sudo' || '' }} | |
| rm -rvf "build/${{ matrix.targetPlatform }}/${{ env.buildName }}_BackUpThisFolder_ButDontShipItWithYourGame" | |
| - name: Archive client | |
| uses: thedoctor0/[email protected] | |
| if: github.ref_type == 'tag' && matrix.targetPlatform != 'Android' | |
| with: | |
| type: "zip" | |
| directory: build/${{ matrix.targetPlatform }} | |
| filename: "${{ github.workspace }}/Basis Unity ${{ matrix.targetPlatform }}.zip" | |
| - name: "Release client zip" | |
| if: github.ref_type == 'tag' && matrix.targetPlatform != 'Android' | |
| timeout-minutes: 5 | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| files: | | |
| ${{ github.workspace }}/Basis Unity ${{ matrix.targetPlatform }}.zip | |
| ${{ github.workspace }}/Basis Unity ${{ matrix.targetPlatform }} Symbols.zip | |
| - name: "Release client apk" | |
| if: github.ref_type == 'tag' && matrix.targetPlatform == 'Android' | |
| timeout-minutes: 5 | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| files: build/${{ matrix.targetPlatform }}/${{ env.buildName }}.apk | |
| build-server: | |
| name: Build server on Ubuntu | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| projectPath: | |
| - Basis Server | |
| runtimes: | |
| - linux-x64 | |
| - linux-musl-x64 | |
| - linux-musl-arm64 | |
| - linux-arm64 | |
| - win-x64 | |
| steps: | |
| - name: "Checkout repository" | |
| timeout-minutes: 5 | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Setup dotnet" | |
| timeout-minutes: 2 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: "Build server" | |
| timeout-minutes: 2 | |
| run: "dotnet publish '${{ matrix.projectPath }}' -f net9.0 --self-contained --runtime '${{ matrix.runtimes }}' -o build -c Release" | |
| - name: "Upload server artifact" | |
| timeout-minutes: 2 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Basis-Server-${{ matrix.runtimes }} | |
| path: "build" | |
| - name: Archive Release | |
| uses: thedoctor0/[email protected] | |
| if: github.ref_type == 'tag' | |
| with: | |
| type: "zip" | |
| directory: build | |
| filename: "Basis Server ${{ matrix.runtimes }}.zip" | |
| - name: "Release server zip" | |
| if: github.ref_type == 'tag' | |
| timeout-minutes: 5 | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| files: build/Basis Server ${{ matrix.runtimes }}.zip | |
| compile-unitypackages: | |
| name: Build .unitypackage files | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: "Checkout repository" | |
| timeout-minutes: 5 | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Produce SDK unitypackage." | |
| timeout-minutes: 5 | |
| run: .github/scripts/unitypackagegen.sh sdk | |
| - name: "Produce full unitypackage." | |
| timeout-minutes: 5 | |
| run: .github/scripts/unitypackagegen.sh full | |
| - uses: actions/upload-artifact@v4 | |
| timeout-minutes: 5 | |
| with: | |
| name: unitypackage_upload | |
| path: | | |
| Basis/Basis.sdk.unitypackage | |
| Basis/Basis.full.unitypackage | |
| - name: "Release unitypackage" | |
| if: github.ref_type == 'tag' | |
| timeout-minutes: 5 | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| files: | | |
| Basis/Basis.sdk.unitypackage | |
| Basis/Basis.full.unitypackage |