-
Notifications
You must be signed in to change notification settings - Fork 57
167 lines (149 loc) · 6.35 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build CYF & Notify
on: [push, pull_request, workflow_dispatch]
jobs:
buildWindows:
name: Build CYF (Windows)
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows64
buildMethod: UnityBuilderAction.BuildScript.Build
buildName: CreateYourFrisk-win64
# Copy Assets to Build
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneWindows64/Default" "${{ github.workspace }}/build/StandaloneWindows64/Mods"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneWindows64/"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneWindows64/"
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build"
- run: sudo find ${{ github.workspace }}/build/StandaloneWindows64/ -name "*.meta" -type f -delete
- run: sudo mv ${{ github.workspace }}/build/StandaloneWindows64/ ${{ github.workspace }}/build/CreateYourFrisk/
# Output
- uses: actions/upload-artifact@v2
with:
name: CreateYourFrisk-win64
path: build
buildMacOS:
name: Build CYF (MacOS)
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneOSX
buildMethod: UnityBuilderAction.BuildScript.Build
buildName: CreateYourFrisk-macos64
# Copy Assets to Build
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneOSX/Default" "${{ github.workspace }}/build/StandaloneOSX/Mods"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneOSX/"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneOSX/"
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build"
- run: sudo cp "${{ github.workspace }}/How to use CYF and add mods (Mac).txt" "${{ github.workspace }}/build/StandaloneOSX/"
- run: sudo find ${{ github.workspace }}/build/StandaloneOSX/ -name "*.meta" -type f -delete
- run: sudo mv ${{ github.workspace }}/build/StandaloneOSX/ ${{ github.workspace }}/build/CreateYourFrisk/
# Output
- uses: actions/upload-artifact@v2
with:
name: CreateYourFrisk-macos64
path: build
buildLinux:
name: Build CYF (Linux)
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneLinux64
buildMethod: UnityBuilderAction.BuildScript.Build
buildName: CreateYourFrisk-lin64
# Copy Assets to Build
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneLinux64/Default" "${{ github.workspace }}/build/StandaloneLinux64/Mods"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneLinux64/"
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneLinux64/"
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build"
- run: sudo find ${{ github.workspace }}/build/StandaloneLinux64/ -name "*.meta" -type f -delete
- run: sudo mv ${{ github.workspace }}/build/StandaloneLinux64/ ${{ github.workspace }}/build/CreateYourFrisk/
# Output
- uses: actions/upload-artifact@v2
with:
name: CreateYourFrisk-lin64
path: build
message-success:
runs-on: ubuntu-latest
needs: [buildWindows, buildMacOS, buildLinux]
if: success()
steps:
- name: Send Success Message
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_LINK }}
username: Poseur Mail Service
avatar-url: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png
content: |
The last CYF nightly is ready to be used! Enjoy!
The links are stored here: https://discord.com/channels/110129114882543616/220238710271115265/1129795830317064314
message-failure:
runs-on: ubuntu-latest
needs: [buildWindows, buildMacOS, buildLinux]
if: failure()
steps:
- name: Send Failure Message
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_LINK }}
username: Poseur Mail Service
avatar-url: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png
content: |
Oh no! The last CYF build failed! You're bad at your job!
The run's details are here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}