90 lines (83 loc) · 3.07 KB
/
unity-build-personal.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: execute-unity-builds
on:
push:
branches:
- unity-deploy
jobs:
build:
name: ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unity-editor-version: [2020.3.26f1]
unity-license-version: [2020.x]
node-version: [14.x]
root-project-path: [Unity]
targetPlatform:
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
- StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- StandaloneLinux64 # Build a Linux 64-bit standalone.
- iOS # Build an iOS player.
- Android # Build an Android .apk standalone app.
- WebGL # WebGL.
steps:
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# Cache
- uses: actions/cache@v3
id: cache-unity-library
with:
key: ${{ runner.os }}-Unity-Library-${{ matrix.targetPlatform }}
path: |
${{ matrix.root-project-path }}/Library
restore-keys: |
${{ runner.os }}-Unity-Library-
# Cache
- uses: actions/cache@v3
id: cache-unity-license
with:
key: ${{ runner.os }}-Unity-License-${{ matrix.unity-license-version }}
path: |
${{ matrix.root-project-path }}/Unity_v${{ matrix.unity-license-version }}.ulf
${{ matrix.root-project-path }}/Unity_v${{ matrix.unity-editor-version }}.alf
# Request Unity Activation File
- name: Request manual activation file
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2
with:
unityVersion: ${{ matrix.unity-editor-version }}
# Activate from alf File
- name: Install node package, `unity-activate`
run: npm install -g unity-activate
- name: Activate The License
id: activateLicense
run: unity-activate -u "${{ secrets.UNITY_EMAIL }}" -p "${{ secrets.UNITY_PASSWORD }}" -k "${{ secrets.UNITY_AUTHENTICATOR_KEY }}" -o ${{ matrix.root-project-path }}/ "${{ steps.getManualLicenseFile.outputs.filePath }}"
- name: Read ulf
id: ulfRead
uses: juliangruber/read-file-action@v1
with:
path: ${{ matrix.root-project-path }}/Unity_v${{ matrix.unity-license-version }}.ulf
# Build
- name: Build
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ steps.ulfRead.outputs.content }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: ${{ matrix.root-project-path }}
allowDirtyBuild: true
# Upload Build
- name: Upload Build
uses: actions/upload-artifact@v3
with:
name: Build-Results
path: build/