-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (172 loc) · 8.63 KB
/
vrchat-world-ci.yml
File metadata and controls
195 lines (172 loc) · 8.63 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Build & Upload VRChat World
on:
push:
branches:
- master
paths-ignore:
- .github/workflows/build-cache.yml
- .github/workflows/build-cache-new.yml
- .github/workflows/cache-unity.yml
- .github/workspace-scripts/
- .github/workflows/vrchat-world-ci-macos.yml
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-and-upload-nightly-world:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
workspace-path: "${{ github.workspace }}"
source-path: "${{ github.workspace }}"
release-path: "${{ github.workspace }}/tmp/release"
add-packages-script-path: "${{ github.workspace }}/.github/workflow-scripts/add-user-package-to-vrc-get.js"
get-serial-script-path: "${{ github.workspace }}/.github/workflow-scripts/get-serial-from-license-file.js"
UNITY_SERIAL: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Unity Installation
id: cache-unity-installation
uses: actions/cache@v4
with:
path: /home/runner/Unity/
key: unity-installation-2022.3.22f1-887be4894c44
- name: Set up Unity
if: steps.cache-unity-installation.outputs.cache-hit != 'true'
id: unity-setup
uses: buildalon/unity-setup@v1.0.20
with:
unity-version: 2022.3.22f1 (887be4894c44)
modules: windows-il2cpp, ios, android
- name: Download Release Package
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2
if: github.event_name == 'release'
with:
latest: true
preRelease: false
out-file-path: ${{ env.release-path }}
fileName: "*.zip"
extract: true
- name: Setup vrc-get
uses: anatawa12/sh-actions/setup-vrc-get@master
# Unity setup is now handled by buildalon/unity-setup@v1.0.20
- name: Add Release Pacakge to vrc-get
if: github.event_name == 'release'
run: "node ${{ env.add-packages-script-path }} ${{ env.release-path }}"
- name: Add VPM Repositories
run: |
yes | vrc-get repo import repositories.txt
vrc-get repo list
- name: Backup the modified VRC autobuild package
run: |
mkdir -p tmp
cp -r Packages/com.yuxiaviation.vrchat.autobuild tmp/com.yuxiaviation.vrchat.autobuild
rm -rf Packages/com.yuxiaviation.vrchat.autobuild
cp -r Packages/com.yuxiaviation.vrchat.autobuild.world tmp/com.yuxiaviation.vrchat.autobuild.world
rm -rf Packages/com.yuxiaviation.vrchat.autobuild.world
- name: Resolve VPM Dependencies
working-directory: ${{ env.workspace-path }}
run: "vrc-get resolve"
- name: Restore modified VRC autobuild package
run: |
rm -rf Packages/com.yuxiaviation.vrchat.autobuild
rm -rf Packages/com.yuxiaviation.vrchat.autobuild.world
cp -r tmp/com.yuxiaviation.vrchat.autobuild Packages/com.yuxiaviation.vrchat.autobuild
cp -r tmp/com.yuxiaviation.vrchat.autobuild.world Packages/com.yuxiaviation.vrchat.autobuild.world
- name: Remove Unsupported Packages
if: runner.os == 'Linux'
working-directory: ${{ env.workspace-path }}
run: |
yes | vrc-get remove dev.foxscore.easy-login au.benjithatfoxguy.templates.world.2022.3.22f1.updater com.nidonocu.vrcunitytoolbar dev.hai-vr.resilience.let-me-see dev.hai-vr.resilience.toolkit unity-editor-dark-mode au.benjithatfoxguy.uerp au.benjithatfoxguy.simplebuttonsui -y || true
rm -rf Assets/Editor Assets/Editor.meta Assets/UERP Assets/UERP.meta || true
- name: Remove Unsupported Packages
if: runner.os == 'Windows'
working-directory: ${{ env.workspace-path }}
shell: pwsh
run: |
$ErrorActionPreference = "SilentlyContinue"
vrc-get remove dev.foxscore.easy-login au.benjithatfoxguy.templates.world.2022.3.22f1.updater com.nidonocu.vrcunitytoolbar au.benjithatfoxguy.batchimportunitypackage au.benjithatfoxguy.restartunity dev.hai-vr.resilience.let-me-see dev.hai-vr.resilience.toolkit unity-editor-dark-mode -y
vrc-get remove numeira.auto-certify-copyright-agreement -y
# - name: Add AutoBuild Packages to Workspace
# if: runner.os == 'Linux'
# working-directory: ${{ env.workspace-path }}
# # run: vrc-get install com.yuxiaviation.vrchat.autobuild.world 0.3.0 -y
# run: vrc-get install com.yuxiaviation.vrchat.autobuild.world -y || true
- name: Add AutoBuild Packages to Workspace
if: runner.os == 'Windows'
working-directory: ${{ env.workspace-path }}
shell: pwsh
# run: vrc-get install com.yuxiaviation.vrchat.autobuild.world 0.3.0 -y
run: |
$ErrorActionPreference = "SilentlyContinue"
vrc-get install com.yuxiaviation.vrchat.autobuild.world -y
- name: Downgrade VRCSDK to 3.7.1
working-directory: ${{ env.workspace-path }}
run: |
vrc-get remove com.vrchat.worlds com.vrchat.base -y
vrc-get install com.vrchat.worlds 3.7.1 -y
vrc-get install com.vrchat.base 3.7.1 -y
- name: Cache Library
uses: actions/cache@v4
with:
path: ${{ env.workspace-path }}/Library
key: Library-Build-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-Build-
- name: Get Unity Serial
if: runner.os == 'Linux'
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
UNITY_SERIAL="$(echo $UNITY_LICENSE | node ${{ env.get-serial-script-path }})"
echo "::add-mask::$UNITY_SERIAL"
echo "UNITY_SERIAL=$UNITY_SERIAL" >> $GITHUB_ENV
- name: Get Unity Serial
if: runner.os == 'Windows'
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
shell: pwsh
run: |
$UNITY_SERIAL = (echo $env:UNITY_LICENSE | node ${{ env.get-serial-script-path }})
Write-Host "::add-mask::$UNITY_SERIAL"
Write-Host "UNITY_SERIAL=$UNITY_SERIAL" >> $env:GITHUB_ENV
- name: Build & Upload VRChat World
if: runner.os == 'Linux'
continue-on-error: true
run: |
"/home/runner/Unity/Hub/Editor/2022.3.22f1/Editor/Unity" -nographics -headless -projectPath "${{ env.workspace-path }}" -username "${{ secrets.UNITY_EMAIL }}" -password "${{ secrets.UNITY_PASSWORD }}" -serial "${{ env.UNITY_SERIAL }}" -batchmode -logFile - -buildTarget Win64 -executeMethod VRChatAerospaceUniversity.VRChatAutoBuild.Worlds.AutoBuildVRChatWorld.BuildAndUploadWorld
env:
VRC_AUTO_BUILD_CONTENT_ID: ${{ secrets.NIGHTLY_WORLD_CONTENT_ID }}
VRC_AUTO_BUILD_SCENE_PATH: Assets\Scenes\VRCDefaultWorldScene.unity
VRC_AUTO_BUILD_USERNAME: ${{ secrets.VRC_AUTO_BUILD_USERNAME }}
VRC_AUTO_BUILD_PASSWORD: ${{ secrets.VRC_AUTO_BUILD_PASSWORD }}
VRC_AUTO_BUILD_TOTP_KEY: ${{ secrets.VRC_AUTO_BUILD_TOTP_KEY }}
VRC_AUTO_BUILD_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_AUTH_COOKIE }}
VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE }}
DISPLAY: ":0"
- name: Build & Upload VRChat World
if: runner.os == 'Windows'
shell: pwsh
run: |
${{ steps.unity-setup.outputs.unity-path }} \
-projectPath "${{ env.workspace-path }}" \
-username "${{ secrets.UNITY_EMAIL }}" \
-password "${{ secrets.UNITY_PASSWORD }}" \
-serial "${{ env.UNITY_SERIAL }}" \
-batchmode -logFile - \
-buildTarget Win64 \
-executeMethod VRChatAerospaceUniversity.VRChatAutoBuild.Worlds.AutoBuildVRChatWorld.BuildAndUploadWorld
env:
VRC_AUTO_BUILD_CONTENT_ID: ${{ secrets.NIGHTLY_WORLD_CONTENT_ID }}
VRC_AUTO_BUILD_SCENE_PATH: Assets\Scenes\VRCDefaultWorldScene.unity
VRC_AUTO_BUILD_USERNAME: ${{ secrets.VRC_AUTO_BUILD_USERNAME }}
VRC_AUTO_BUILD_PASSWORD: ${{ secrets.VRC_AUTO_BUILD_PASSWORD }}
VRC_AUTO_BUILD_TOTP_KEY: ${{ secrets.VRC_AUTO_BUILD_TOTP_KEY }}
VRC_AUTO_BUILD_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_AUTH_COOKIE }}
VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE: ${{ secrets.VRC_AUTO_BUILD_TWO_FACTOR_AUTH_COOKIE }}