forked from VRCFury/VRCFury
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (103 loc) · 3.75 KB
/
deploy.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
name: 'Deploy'
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PROJECT_PATH: .github/workflows/test_project
strategy:
fail-fast: false
matrix:
vrcsdkVersion:
- 3.3.0
- 3.0.9
- 2022.06.03.00.04
unityImage:
- unityci/editor:ubuntu-2019.4.31f1-windows-mono-2.0.0
- unityci/editor:ubuntu-2019.4.31f1-android-2.0.0
include:
- vrcsdkVersion: 3.5.0
unityImage: unityci/editor:ubuntu-2022.3.6f1-windows-mono-3.0.1
- vrcsdkVersion: 3.5.0
unityImage: unityci/editor:ubuntu-2022.3.6f1-android-3.0.1
- vrcsdkVersion: 3.5.2
unityImage: unityci/editor:ubuntu-2022.3.6f1-windows-mono-3.0.1
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.PROJECT_PATH }}/Library
key: Library-${{ matrix.unityImage }}-${{ matrix.vrcsdkVersion }}
restore-keys: |
Library-${{ matrix.unityImage }}
Library-
- name: Download VRCSDK
run: |
VERSION="${{ matrix.vrcsdkVersion }}"
echo "Downloading VRCSDK $VERSION"
if [[ "$VERSION" == "2022.06.03.00.04" ]]; then
curl -L -o "vrcsdk.zip" "https://github.com/VRCFury/VRCFury/releases/download/old-vrcsdk/VRCSDK.zip"
unzip "vrcsdk.zip" -d "$PROJECT_PATH/Assets"
else
MANIFEST_URL="https://vrchat.github.io/packages/index.json"
echo "Downloading manifest from $MANIFEST_URL"
MANIFEST="$(curl "$MANIFEST_URL")"
AV_URL="$(echo "$MANIFEST" | jq ".packages.\"com.vrchat.avatars\".versions.\"$VERSION\".url" --raw-output)"
echo "Avatar SDK URL is $AV_URL"
BASE_URL="$(echo "$MANIFEST" | jq ".packages.\"com.vrchat.base\".versions.\"$VERSION\".url" --raw-output)"
echo "Base SDK URL is $BASE_URL"
curl -L -o "avatars.zip" "$AV_URL"
curl -L -o "base.zip" "$BASE_URL"
mkdir -p "$PROJECT_PATH/Packages/com.vrchat.avatars"
mkdir -p "$PROJECT_PATH/Packages/com.vrchat.base"
unzip avatars.zip -d "$PROJECT_PATH/Packages/com.vrchat.avatars"
unzip base.zip -d "$PROJECT_PATH/Packages/com.vrchat.base"
fi
- name: Run Tests
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
chmod +x .github/workflows/test_ci.sh
docker run --rm \
--env UNITY_LICENSE \
--volume="${PWD}:/opt/project" \
${{ matrix.unityImage }} \
/opt/project/.github/workflows/test_ci.sh
deploy:
needs: test
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
environment: prod
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: repo
- name: Checkout version manifest
uses: actions/checkout@v4
with:
path: versions
repository: VRCFury/vrcfury-updater-manifest
ssh-key: ${{ secrets.VERSION_DEPLOY_KEY }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Bundle
working-directory: repo
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
(cd .github/workflows && npm install)
node .github/workflows/bundle.js
- name: Push version manifest
working-directory: versions
run: |
git diff
git config user.name VRCFury Releases
git config user.email [email protected]
git diff --quiet || git commit -am "Release from $GITHUB_SHA"
git push