-
-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (116 loc) · 4.72 KB
/
build.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Bestagon-Defence build
on:
push:
pull_request:
types:
- opened
workflow_dispatch:
jobs:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ${{ matrix.jobOS }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
# Temporarily disabled as it wasn't working
#- targetPlatform: StandaloneOSX # Build a macOS standalone (Intel 64-bit).
# jobOS: macos-latest
- targetPlatform: StandaloneWindows # Build a Windows standalone.
jobOS: ubuntu-latest
- targetPlatform: StandaloneWindows64 # Build a Windows 64-bit standalone.
jobOS: ubuntu-latest
- targetPlatform: StandaloneLinux64 # Build a Linux 64-bit standalone.
jobOS: ubuntu-latest
# - targetPlatform: iOS # Build an iOS player.
# jobOS: ubuntu-latest
# - targetPlatform: Android # Build an Android .apk standalone app.
# jobOS: ubuntu-latest
# - targetPlatform: WebGL # WebGL.
# jobOS: ubuntu-latest
outputs:
StandaloneOSX: ${{ steps.outputResult.outputs.StandaloneOSX }}
StandaloneWindows: ${{ steps.outputResult.outputs.StandaloneWindows }}
StandaloneWindows64: ${{ steps.outputResult.outputs.StandaloneWindows64 }}
StandaloneLinux64: ${{ steps.outputResult.outputs.StandaloneLinux64 }}
#iOS: ${{ steps.outputResult.outputs.iOS }}
Android: ${{ steps.outputResult.outputs.Android }}
#WebGL: ${{ steps.outputResult.outputs.WebGL }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
- uses: game-ci/unity-builder@v3
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# Use for paid version:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
# Use for free version:
#UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: 'Tower Defence'
targetPlatform: ${{ matrix.targetPlatform }}
if: ${{ matrix.targetPlatform != 'Android' }}
- uses: game-ci/unity-builder@v3
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# Use for paid version:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
# Use for free version:
#UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: 'Tower Defence'
targetPlatform: ${{ matrix.targetPlatform }}
androidKeystoreName: user # This file won't exist, but this property needs to exist.
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
androidTargetSdkVersion: AndroidApiLevel31
if: ${{ matrix.targetPlatform == 'Android' }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.targetPlatform }}
path: |
build/
!*DoNotShip/
# Return License
# - uses: game-ci/unity-return-license@v2.0.0
# if: always()
- id: outputResult
run: echo "${{ matrix.targetPlatform }}Result=${{ job.status }}" >> $GITHUB_ENV
sendSuccessNotification:
runs-on: ubuntu-latest
needs:
- buildForAllSupportedPlatforms
if: ${{ success() }}
steps:
- uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_URL }}
content: "Build Success"
embed-title: "New Nightly Build Available!"
embed-description: "[You can get the new builds here](https://github.com/Greenfoot5/Bestagon-Defence/actions/runs/${{ github.run_id }})
\n${{ env.StandaloneWindowsResult }}\n*You may need to scroll down to the bottom*"
embed-color: 1546855
sendFailureNotification:
runs-on: ubuntu-latest
needs:
- buildForAllSupportedPlatforms
if: ${{ failure() }}
steps:
- uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_URL }}
content: "Build Failure"
embed-title: "New Nightly Build Failed!"
embed-description: "[You can find the results here](https://github.com/Greenfoot5/Bestagon-Defence/actions/runs/${{ github.run_id }})\n${{ env.StandaloneWindowsResult }}"
embed-color: 10949957