-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (76 loc) · 2.44 KB
/
build-sample-webgl.yaml
File metadata and controls
87 lines (76 loc) · 2.44 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
name: Build Sample WebGL
on:
workflow_dispatch:
inputs:
sample:
description: Sample base name to build
required: true
type: choice
options:
- 2d-platformer
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-sample:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Cache Unity Library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ runner.os }}-2022.3.62f3-${{ hashFiles('Packages/com.playroomkit.sdk/package.json', 'Packages/manifest.json', 'Packages/packages-lock.json') }}
restore-keys: |
Library-${{ runner.os }}-2022.3.62f3-
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Resolve sample scene
run: |
case "${{ inputs.sample }}" in
2d-platformer)
echo "SAMPLE_SCENE=Packages/com.playroomkit.sdk/Samples~/2d-platformer/2d-platformer.unity" >> $GITHUB_ENV
echo "SAMPLE_SCENE_GUID=cf82eec4c654cf44b89cec2a91afebd5" >> $GITHUB_ENV
;;
*)
echo "Unknown sample: ${{ inputs.sample }}"
exit 1
;;
esac
echo "BUILD_OUTPUT=build/webgl/${{ inputs.sample }}" >> $GITHUB_ENV
- name: Set build scenes
run: |
cat > ProjectSettings/EditorBuildSettings.asset <<EOF
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: ${SAMPLE_SCENE}
guid: ${SAMPLE_SCENE_GUID}
m_configObjects: {}
EOF
- name: Build WebGL sample
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: 2022.3.62f3
targetPlatform: WebGL
allowDirtyBuild: true
buildsPath: ${{ env.BUILD_OUTPUT }}
- name: Upload WebGL build
uses: actions/upload-artifact@v4
with:
name: webgl-${{ inputs.sample }}
path: build/webgl/${{ inputs.sample }}