Repository navigation
93 lines (84 loc) · 2.82 KB
/
Copy pathrelease.yml
File metadata and controls
93 lines (84 loc) · 2.82 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
88
89
90
91
92
93
name: Gothic Release Job
on:
release:
types:
- published
jobs:
#########
# BUILD #
#########
buildForAllPlatforms:
name: Build Gothic for ${{ matrix.targetDevice }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- targetPlatform: StandaloneWindows64
targetDevice: Windows64
- targetPlatform: Android
targetDevice: Pico
- targetPlatform: Android
targetDevice: Quest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
clean: true
# Cache
- uses: actions/cache@v4
with:
path: Library
key: Library-Xri-${{ matrix.targetPlatform }}
restore-keys: Library-Xri-
# Set Version
- name: set Version
run: |
ref="${{ github.ref }}"
tag="${ref#refs/tags/}"
echo "Version: $tag"
sed -i "s/bundleVersion: 0.1/bundleVersion: $tag/" ProjectSettings/ProjectSettings.asset
# Build
- name: Build 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 }}
allowDirtyBuild: true
buildMethod: Gothic.VR.Editor.VRBuilderActions.Perform${{ matrix.targetDevice }}Build
# Android Keystore settings
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystoreName: Gothic.keystore
customParameters: >
-keystoreName "Gothic.keystore"
-keystorePass "${{ secrets.ANDROID_KEYSTORE_PASS }}"
-keyaliasName "${{ secrets.ANDROID_KEYALIAS_NAME }}"
-keyaliasPass "${{ secrets.ANDROID_KEYALIAS_PASS }}"
# Zip into workspace folder (overcoming permission errors)
- name: zip
run: |
cd Builds/${{ matrix.targetDevice }}
zip -r ../../${{ matrix.targetDevice }}.zip *
# Release
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.targetDevice }}.zip
asset_name: Gothic-Unity-${{ matrix.targetDevice }}.zip
asset_content_type: application/zip