90 lines
3.2 KiB
YAML
90 lines
3.2 KiB
YAML
name: "Unity Build Workflow"
|
|
on:
|
|
workflow_call:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.PACKAGE_APIKEY }}
|
|
SKIP_CACHE: ${{ vars.SKIP_CACHE && vars.SKIP_CACHE || 'false' }}
|
|
ZIP_COMPRESSION_LEVEL: ${{ vars.ZIP_COMPRESSION_LEVEL && vars.ZIP_COMPRESSION_LEVEL || '9' }}
|
|
|
|
UNITY_COMPRESSION_LEVEL: lz4hc
|
|
UNITY_ZIP_ON_COMPLETE: false
|
|
UNITY_USERNAME: ${{ secrets.UNITY_USERNAME }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
NO_GRAPHICS: ${{ vars.NO_GRAPHICS && vars.NO_GRAPHICS || 'true' }}
|
|
|
|
# For the Android keystore.
|
|
MINIO_URL: ${{ vars.MINIO_URL && vars.MINIO_URL || 'https://minio.studiowhy.net' }}
|
|
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY }}
|
|
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY }}
|
|
|
|
UNITY_KEYSTORE_PATH: ${{ vars.UNITY_KEYSTORE_PATH && vars.UNITY_KEYSTORE_PATH || 'studiowhy.keystore' }}
|
|
UNITY_KEYSTORE_KEY_ALIAS: ${{ vars.UNITY_KEYSTORE_ALIAS && vars.UNITY_KEYSTORE_ALIAS || 'studiowhy' }}
|
|
UNITY_KEYSTORE_PASSWORD: ${{ secrets.UNITY_KEYSTORE_PASSWORD }}
|
|
UNITY_KEYSTORE_KEY_PASSWORD: ${{ secrets.UNITY_KEYSTORE_KEY_PASSWORD }}
|
|
jobs:
|
|
build-unity-master1:
|
|
name: "Build ${{ matrix.platform.os }}"
|
|
runs-on: master1
|
|
strategy:
|
|
max-parallel: 1
|
|
matrix:
|
|
platform:
|
|
- os: Windows
|
|
method: StudioWhy.BatchBuild.BuildWindows
|
|
- os: Windows32Bit
|
|
method: StudioWhy.BatchBuild.BuildWindows32Bit
|
|
suffix: Windows_32bit
|
|
- os: WindowsARM
|
|
method: StudioWhy.BatchBuild.BuildWindowsArm
|
|
suffix: Windows_ARM
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: https://github.com/actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
token: ${{ env.GITEA_TOKEN }}
|
|
- name: "Build Unity Project"
|
|
uses: act/unity/unity-project-cached-artifacts@master
|
|
with:
|
|
platform: ${{ matrix.platform.os }}
|
|
email: ${{ env.UNITY_USERNAME }}
|
|
password: ${{ env.UNITY_PASSWORD }}
|
|
executeMethod: ${{ matrix.platform.method }}
|
|
noGraphics: ${{ env.NO_GRAPHICS }}
|
|
artifactSuffix: ${{ matrix.platform.suffix || matrix.platform.os }}
|
|
compression-level: ${{ env.ZIP_COMPRESSION_LEVEL }}
|
|
skipRestore: ${{ env.SKIP_CACHE }}
|
|
|
|
build-unity-master2:
|
|
name: "Build ${{ matrix.platform.os }}"
|
|
runs-on: master2
|
|
strategy:
|
|
max-parallel: 1
|
|
matrix:
|
|
platform:
|
|
- os: OSX
|
|
method: StudioWhy.BatchBuild.BuildOSX
|
|
- os: Linux
|
|
method: StudioWhy.BatchBuild.BuildLinux
|
|
- os: Android
|
|
method: StudioWhy.BatchBuild.BuildAndroid
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: https://github.com/actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
token: ${{ env.GITEA_TOKEN }}
|
|
- name: "Build Unity Project"
|
|
uses: act/unity/unity-project-cached-artifacts@master
|
|
with:
|
|
platform: ${{ matrix.platform.os }}
|
|
email: ${{ env.UNITY_USERNAME }}
|
|
password: ${{ env.UNITY_PASSWORD }}
|
|
executeMethod: ${{ matrix.platform.method }}
|
|
noGraphics: ${{ env.NO_GRAPHICS }}
|
|
artifactSuffix: ${{ matrix.platform.suffix || matrix.platform.os }}
|
|
compression-level: ${{ env.ZIP_COMPRESSION_LEVEL }}
|
|
skipRestore: ${{ env.SKIP_CACHE }}
|