-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (68 loc) · 2.34 KB
/
build_game.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
name: Build Game
on:
workflow_call:
inputs:
unityPlatform:
description: 'Target platform of the built artifact'
type: string
required: true
versionNumber:
description: 'Pre-generated version number'
type: string
required: true
outputName:
description: 'Name of the artifact generated'
type: string
required: true
jobs:
buildGame:
name: "${{ inputs.unityPlatform }} build"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create Sentry Credentials from Secrets
run: |
mkdir -p unity-ggjj/Assets/Plugins/Sentry
echo "$SENTRY_CLI_OPTIONS" >> unity-ggjj/Assets/Plugins/Sentry/SentryCliOptions.asset
shell: bash
env:
SENTRY_CLI_OPTIONS: ${{secrets.SENTRY_CLI_OPTIONS}}
- name: Create LFS file list
shell: bash
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v4
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Git LFS Pull
shell: bash
run: |
git lfs pull
git add .
git reset --hard
- name: Restore Library cache
uses: actions/cache@v4
with:
path: unity-ggjj/Library
key: Library-${{ hashFiles('unity-ggjj/Assets/**', 'unity-ggjj/Packages/**', 'unity-ggjj/ProjectSettings/**') }}
restore-keys: |
unity-ggjj/Library-
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: unity-ggjj/
targetPlatform: ${{ inputs.unityPlatform }}
buildName: 'Game Grumps - Joint Justice'
customParameters: "${{ (github.event.inputs.createRelease != 'true') && '-Development -AllowDebugging' }}"
- name: Upload '${{ inputs.outputName }}' artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.outputName }}-v${{ inputs.versionNumber }}
path: build/${{ inputs.unityPlatform }}