Refactor main workflow
This commit is contained in:
parent
75deb2d5a9
commit
3685430cb1
61
.github/workflows/main.yml
vendored
61
.github/workflows/main.yml
vendored
@ -5,10 +5,9 @@ on:
|
|||||||
push: {}
|
push: {}
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
### Refer to https://game.ci/docs/github/getting-started
|
||||||
jobs:
|
jobs:
|
||||||
checklicense:
|
checklicense:
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
name: Check for UNITY_LICENSE in GitHub Secrets
|
name: Check for UNITY_LICENSE in GitHub Secrets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
@ -16,6 +15,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check whether unity activation requests should be done
|
- name: Check whether unity activation requests should be done
|
||||||
id: checklicense_job
|
id: checklicense_job
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}"
|
echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}"
|
||||||
export is_unity_license_set="${{ env.UNITY_LICENSE != '' }}"
|
export is_unity_license_set="${{ env.UNITY_LICENSE != '' }}"
|
||||||
@ -43,23 +46,21 @@ jobs:
|
|||||||
if: needs.checklicense.outputs.is_unity_license_set == 'true'
|
if: needs.checklicense.outputs.is_unity_license_set == 'true'
|
||||||
name: Run all tests ✨
|
name: Run all tests ✨
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
||||||
PROJECT_PATH: .
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PROJECT_PATH }}/Library
|
path: Library
|
||||||
key: Library-test
|
key: Library-test
|
||||||
- uses: game-ci/unity-test-runner@v2
|
- uses: game-ci/unity-test-runner@v2
|
||||||
id: testRunner
|
id: testRunner
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
with:
|
with:
|
||||||
projectPath: ${{ env.PROJECT_PATH }}
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@ -70,11 +71,6 @@ jobs:
|
|||||||
needs: [test]
|
needs: [test]
|
||||||
name: Build for ${{ matrix.targetPlatform }}
|
name: Build for ${{ matrix.targetPlatform }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
||||||
PROJECT_PATH: .
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -89,26 +85,24 @@ jobs:
|
|||||||
lfs: true
|
lfs: true
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PROJECT_PATH }}/Library
|
path: Library
|
||||||
key: Library-${{ matrix.targetPlatform }}
|
key: Library-${{ matrix.targetPlatform }}
|
||||||
- uses: game-ci/unity-builder@v2
|
- uses: game-ci/unity-builder@v2
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
with:
|
with:
|
||||||
projectPath: ${{ env.PROJECT_PATH }}
|
|
||||||
targetPlatform: ${{ matrix.targetPlatform }}
|
targetPlatform: ${{ matrix.targetPlatform }}
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Build-${{ matrix.targetPlatform }}
|
name: Build-${{ matrix.targetPlatform }}
|
||||||
path: ${{ env.PROJECT_PATH }}/build
|
path: build
|
||||||
|
|
||||||
buildWithMac:
|
buildWithMac:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
name: Build for ${{ matrix.targetPlatform }}
|
name: Build for ${{ matrix.targetPlatform }}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
||||||
PROJECT_PATH: .
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -120,26 +114,24 @@ jobs:
|
|||||||
lfs: true
|
lfs: true
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PROJECT_PATH }}/Library
|
path: Library
|
||||||
key: Library-${{ matrix.targetPlatform }}
|
key: Library-${{ matrix.targetPlatform }}
|
||||||
- uses: game-ci/unity-builder@v2
|
- uses: game-ci/unity-builder@v2
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
with:
|
with:
|
||||||
projectPath: ${{ env.PROJECT_PATH }}
|
|
||||||
targetPlatform: ${{ matrix.targetPlatform }}
|
targetPlatform: ${{ matrix.targetPlatform }}
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Build-${{ matrix.targetPlatform }}
|
name: Build-${{ matrix.targetPlatform }}
|
||||||
path: ${{ env.PROJECT_PATH }}/build
|
path: build
|
||||||
|
|
||||||
buildWithWindows:
|
buildWithWindows:
|
||||||
needs: [buildWithMac]
|
needs: [buildWithMac]
|
||||||
name: Build for ${{ matrix.targetPlatform }}
|
name: Build for ${{ matrix.targetPlatform }}
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
||||||
PROJECT_PATH: .
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -153,13 +145,16 @@ jobs:
|
|||||||
lfs: true
|
lfs: true
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ env.PROJECT_PATH }}/Library
|
path: Library
|
||||||
key: Library-${{ matrix.targetPlatform }}
|
key: Library-${{ matrix.targetPlatform }}
|
||||||
- uses: game-ci/unity-builder@v2
|
- uses: game-ci/unity-builder@v2
|
||||||
|
env:
|
||||||
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
with:
|
with:
|
||||||
projectPath: ${{ env.PROJECT_PATH }}
|
|
||||||
targetPlatform: ${{ matrix.targetPlatform }}
|
targetPlatform: ${{ matrix.targetPlatform }}
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Build-${{ matrix.targetPlatform }}
|
name: Build-${{ matrix.targetPlatform }}
|
||||||
path: ${{ env.PROJECT_PATH }}/build
|
path: build
|
||||||
|
Loading…
Reference in New Issue
Block a user