64 lines
2.3 KiB
YAML
64 lines
2.3 KiB
YAML
name: build
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
jobs:
|
|
|
|
checklicense:
|
|
name: Check for UNITY_LICENSE in GitHub Secrets
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }}
|
|
steps:
|
|
- name: Check whether unity activation requests should be done
|
|
id: checklicense_job
|
|
env:
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
run: |
|
|
echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}"
|
|
export is_unity_license_set="${{ env.UNITY_LICENSE != '' }}"
|
|
echo "is_unity_license_set=$is_unity_license_set" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
name: Build for ${{ matrix.targetPlatform }}
|
|
needs: checklicense
|
|
runs-on:
|
|
- ubuntu-latest
|
|
container:
|
|
volumes:
|
|
- /volume1/docker/gitea_actions/act:/volume1/docker/gitea_actions/act
|
|
- /volume1/docker/gitea_actions/workspace:/volume1/docker/gitea_actions/workspace
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
targetPlatform:
|
|
# - Android
|
|
- WebGL
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
with:
|
|
lfs: true
|
|
- uses: actions/cache@v4.2.2
|
|
with:
|
|
path: Library
|
|
key: Library-${{ matrix.targetPlatform }}
|
|
- uses: https://git.chikalin.space/unity/unity-builder@3f0b142a5a1333f6b746a17b13a92db8219c9f5d
|
|
options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
|
|
env:
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
# JOB_CONTAINER_NAME: ${{ env.JOB_CONTAINER_NAME }}
|
|
ACTION_FOLDER: /volume1/docker/gitea_actions/act/89fa79d6bd3aaa9f7d3b54bdd5ab294be883964442f1a7519922be8d66f94342/dist
|
|
with:
|
|
targetPlatform: ${{ matrix.targetPlatform }}
|
|
dockerCpuLimit: 0
|
|
RUNNER_TEMP: /volume1/docker/gitea_actions/act/temp
|
|
dockerWorkspacePath: /volume1/docker/gitea_actions/workspace/unity/textdecalURP # this is from volume
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Build-${{ matrix.targetPlatform }}
|
|
path: build |