-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (129 loc) · 4.56 KB
/
BuildOnDemand.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Build On Demand
on:
workflow_dispatch:
inputs:
targets:
description: "Build Target(s)"
required: false
default: "all"
jobs:
build-and-upload-linux:
if: |
(github.event.inputs.targets == '' ||
github.event.inputs.targets == 'all' ||
contains(github.event.inputs.targets, 'linux'))
name: Generate And Upload Linux Build Files
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2020.3.11f1-base-0.15.0
env:
DOTNET_ROOT: "/opt/unity/Editor/Data/NetCore/Sdk-2.2.107"
steps:
- name: Install dependencies
run: |
apt update && apt install sudo
sudo apt-get install -y zip
sudo apt-get install -y make
- name: Activate unity
# exit code is 1 for manual activation
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
echo "$UNITY_LICENSE" | tr -d '\r' > UnityLicenseFile.ulf
unity-editor -nographics -logFile /dev/stdout -manualLicenseFile UnityLicenseFile.ulf -quit | echo "Activation finished"
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Library
id: cache-library
uses: actions/cache@v2
with:
path: Library
key: Library-2020.3.11-linux
- name: Generate Build
run: |
make linux UNITY_EXECUTABLE=unity-editor
echo "LINUX_BUILD_NAME=Linux" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.LINUX_BUILD_NAME }}
path: ./Build/${{ env.LINUX_BUILD_NAME }}
build-and-upload-windows:
if: |
(github.event.inputs.targets == '' ||
github.event.inputs.targets == 'all' ||
contains(github.event.inputs.targets, 'windows'))
name: Generate And Upload Windows Build Files
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2020.3.11f1-windows-mono-0.15.0
env:
DOTNET_ROOT: "/opt/unity/Editor/Data/NetCore/Sdk-2.2.107"
steps:
- name: Install dependencies
run: |
apt update && apt install sudo
sudo apt-get install -y zip
sudo apt-get install -y make
- name: Activate unity
# exit code is 1 for manual activation
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
echo "$UNITY_LICENSE" | tr -d '\r' > UnityLicenseFile.ulf
unity-editor -nographics -logFile /dev/stdout -manualLicenseFile UnityLicenseFile.ulf -quit | echo "Activation finished"
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Library
id: cache-library
uses: actions/cache@v2
with:
path: Library
key: Library-2020.3.11-windows
- name: Generate Build
run: |
make windows UNITY_EXECUTABLE=unity-editor
echo "WINDOWS_BUILD_NAME=Windows" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WINDOWS_BUILD_NAME }}
path: ./Build/${{ env.WINDOWS_BUILD_NAME }}
build-and-upload-webgl:
if: |
(github.event.inputs.targets == '' ||
github.event.inputs.targets == 'all' ||
contains(github.event.inputs.targets, 'web'))
name: Generate And Upload WebGL Build Files
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2020.3.11f1-webgl-0.15.0
env:
DOTNET_ROOT: "/opt/unity/Editor/Data/NetCore/Sdk-2.2.107"
steps:
- name: Install dependencies
run: |
apt update && apt install sudo
sudo apt-get install -y zip
sudo apt-get install -y make
- name: Activate unity
# exit code is 1 for manual activation
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
echo "$UNITY_LICENSE" | tr -d '\r' > UnityLicenseFile.ulf
unity-editor -nographics -logFile /dev/stdout -manualLicenseFile UnityLicenseFile.ulf -quit | echo "Activation finished"
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache Library
id: cache-library
uses: actions/cache@v2
with:
path: Library
key: Library-2020.3.11-webgl
- name: Generate Build
run: |
make webgl UNITY_EXECUTABLE=unity-editor
echo "WEB_BUILD_NAME=Web" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.WEB_BUILD_NAME }}
path: ./Build/${{ env.WEB_BUILD_NAME }}