-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.92 KB
/
release-upload.yaml
File metadata and controls
66 lines (59 loc) · 1.92 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
name: Build and Upload
on:
push:
tags:
- 'v*'
jobs:
# Checks Unity license.
checklicense:
name: Check for UNITY_LICENSE in GitHub Secrets
runs-on: ubuntu-latest
outputs:
is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }}
steps:
- name: Check whether Unity activation should be done
id: checklicense_job
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
if [[ -n "${UNITY_LICENSE}" ]]; then
echo "is_unity_license_set=true" >> $GITHUB_OUTPUT
else
echo "is_unity_license_set=false" >> $GITHUB_OUTPUT
fi
build_and_upload:
name: Build and Upload for ${{ matrix.targetPlatform }}
needs: [checklicense]
if: needs.checklicense.outputs.is_unity_license_set == 'true'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneWindows64
steps:
# Checkout the repository.
- uses: actions/checkout@v6
with:
fetch-depth: 0
# Cache the Unity Library folder to speed up subsequent builds.
- uses: actions/cache@v5
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
# Build the Unity project.
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
# Upload the build folder as a workflow artifact.
- uses: actions/upload-artifact@v7
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}