-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (108 loc) · 4.9 KB
/
build-upload-vrchat-world.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
name: Build & Upload VRChat World
on:
push:
branches:
- main
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-and-upload-nightly-world:
runs-on: ubuntu-latest
env:
unity-docker-image: unityci/editor:ubuntu-2022.3.22f1-windows-mono-3.1.0
workspace-path: "${{ github.workspace }}/workspace"
source-path: "${{ github.workspace }}/source"
add-packages-script-path: "${{ github.workspace }}/source/.github/workflow-scripts/add-user-package-to-vrc-get.js"
get-serial-script-path: "${{ github.workspace }}/source/.github/workflow-scripts/get-serial-from-license-file.js"
UNITY_SERIAL: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
steps:
- name: Checkout
uses: actions/checkout@v4
if: github.event_name != 'release'
with:
path: ${{ env.source-path }}
- name: Download Release Package
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2
if: github.event_name == 'release'
with:
latest: true
preRelease: false
out-file-path: ${{ env.source-path }}
fileName: "*.zip"
extract: true
- name: Download Workspace Project
uses: robinraju/release-downloader@a96f54c1b5f5e09e47d9504526e96febd949d4c2
with:
repository: ${{ secrets.WORKSPACE_PROJECT_REPOSITORY }}
tag: ${{ secrets.WORKSPACE_PROJECT_TAG }}
out-file-path: ${{ env.workspace-path }}
fileName: "*.zip"
extract: true
token: ${{ secrets.ACTION_GITHUB_TOKEN }}
- name: Setup vrc-get
uses: anatawa12/sh-actions/setup-vrc-get@master
- name: Add VPM Repositories
run: |
vrc-get repo add https://vpm.gyoku.tech/vpm.json
vrc-get repo add https://pkg-index.yuxiaviation.com
vrc-get repo add https://orels1.github.io/UdonToolkit/index.json
vrc-get repo add https://vrcd-community.github.io/vpm-packages/index.json
vrc-get repo list
- name: Resolve VPM Dependencies
working-directory: ${{ env.workspace-path }}
run: "vrc-get resolve"
- name: Add Source Package to vrc-get
if: github.event_name != 'release'
run: "node ${{ env.add-packages-script-path }} ${{ env.source-path }}/src/Packages/com.yuxiaviation.v320neo.fdmi"
- name: Add Release Pacakge to vrc-get
if: github.event_name == 'release'
run: "node ${{ env.add-packages-script-path }} ${{ env.source-path }}"
- name: Add Source Pacakge to Workspace
working-directory: ${{ env.workspace-path }}
run: "vrc-get install com.yuxiaviation.v320neo.fdmi -y"
- name: Add AutoBuild Packages to Workspace
working-directory: ${{ env.workspace-path }}
run: vrc-get install com.yuxiaviation.vrchat.autobuild.world -y
- name: Add Patcher Package to fix SDK Build on Linux
working-directory: ${{ env.workspace-path }}
run: vrc-get install cn.org.vrcd.vpm.vrchat-sdk-patcher.worlds -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
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: Build & Upload VRChat World
run: |
docker run \
-v ${{ env.workspace-path }}:/project \
-v ${{ github.workspace }}/tmp:/tmp/DefaultCompany/ \
-e VRC_AUTO_BUILD_USERNAME=$VRC_AUTO_BUILD_USERNAME \
-e VRC_AUTO_BUILD_PASSWORD=$VRC_AUTO_BUILD_PASSWORD \
-e VRC_AUTO_BUILD_TOTP_KEY=$VRC_AUTO_BUILD_TOTP_KEY \
-e VRC_AUTO_BUILD_SCENE_PATH=$VRC_AUTO_BUILD_SCENE_PATH \
-e VRC_AUTO_BUILD_CONTENT_ID=$VRC_AUTO_BUILD_CONTENT_ID \
${{ env.unity-docker-image }} \
unity-editor -projectPath /project \
-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: ${{ vars.NIGHTLY_WORLD_CONTENT_ID }}
VRC_AUTO_BUILD_SCENE_PATH: ${{ secrets.WORKSPACE_SCENE_PATH }}
VRC_AUTO_BUILD_USERNAME: ${{ secrets.VRCHAT_USERNAME }}
VRC_AUTO_BUILD_PASSWORD: ${{ secrets.VRCHAT_PASSWORD }}
VRC_AUTO_BUILD_TOTP_KEY: ${{ secrets.VRCHAT_TOTP_KEY }}