-
Notifications
You must be signed in to change notification settings - Fork 178
153 lines (132 loc) · 5.18 KB
/
build-release-mac.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
name: Builds - MacOS (release)
on:
workflow_dispatch:
inputs:
version:
description: "Version (x.xx.x)"
required: true
type: string
createZip:
description: "Create .zip file"
default: true
type: boolean
createTar:
description: "Create .tar.bz2 file"
default: true
type: boolean
createDmg:
description: "Create .dmg file"
default: true
type: boolean
# concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# cancel-in-progress: true
jobs:
macBuilder:
name: Mac Build for v${{ inputs.version }}
runs-on: macos-latest
steps:
###########################
# Checkout #
###########################
- name: "[Pre-install] Pull project"
uses: actions/checkout@v3
with:
lfs: true
###########################
# Cache #
###########################
- name: "[Pre-install] Restore 'library' cache"
uses: actions/cache@v3
with:
path: Library
key: YARG-Library-macos-StandaloneOSX
restore-keys: |
YARG-Library-macos-
YARG-Library-
###########################
# Install Blender #
###########################
- name: "[Pre-install] Get Blender (3.4.1) from cache"
id: blender
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/BlenderInstall
key: blender-3.4.1
restore-keys: blender-
- if: ${{ steps.blender.outputs.cache-hit != 'true' }}
name: "[Pre-install] Download Blender (3.4.1)"
continue-on-error: true
run: mkdir ${{ runner.temp }}/BlenderInstall && curl -L -o "${{ runner.temp }}/BlenderInstall/blender.dmg" https://download.blender.org/release/Blender3.4/blender-3.4.1-macos-x64.dmg
# - name: "[Pre-install] Install Blender"
# run: brew install --cask blender
- name: "[Pre-install] Install Blender (3.4.1)"
run: >
hdiutil attach ${{ runner.temp }}/BlenderInstall/blender.dmg &&
cp -R /Volumes/Blender/Blender.app /Applications &&
hdiutil unmount /Volumes/Blender
###########################
# Restore Packages #
###########################
- name: "[Pre-install] Restoring NuGet Packages"
run: dotnet tool install --global NuGetForUnity.Cli && nugetforunity restore
###########################
# Build #
###########################
- name: "[Build] Run Builder"
uses: game-ci/[email protected]
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildName: YARG
unityVersion: 2021.3.21f1
targetPlatform: StandaloneOSX
cacheUnityInstallationOnMac: true
###########################
# Compress #
###########################
- if: ${{ inputs.createZip == true }}
name: "[Post-build] Compress to a .zip"
run: ditto -c -k --keepParent build/StandaloneOSX/YARG.app YARG_v${{ inputs.version }}-MacOS-Universal.zip
- if: ${{ inputs.createZip == true }}
name: "[Post-build] Upload .zip to artifacts"
uses: actions/upload-artifact@v3
with:
name: YARG_v${{ inputs.version }}-MacOS-Universal.zip
path: YARG_v${{ inputs.version }}-MacOS-Universal.zip
###########################
# Compress .tar.bz2 #
###########################
- if: ${{ inputs.createTar == true }}
name: "[Post-build] Compress to a .tar.bz2"
run: tar --xattrs -c -j -f YARG_v${{ inputs.version }}-MacOS-Universal.tar.bz2 build/StandaloneOSX/YARG.app
- if: ${{ inputs.createTar == true }}
name: "[Post-build] Upload .tar.bz2 to artifacts"
uses: actions/upload-artifact@v3
with:
name: YARG_v${{ inputs.version }}-MacOS-Universal.tar.bz2
path: YARG_v${{ inputs.version }}-MacOS-Universal.tar.bz2
###########################
# Create .DMG #
###########################
- if: ${{ inputs.createDmg == true }}
name: "[Post-build] Create .dmg"
continue-on-error: true
run: >
echo "- Installing create-dmg" &&
brew install graphicsmagick imagemagick &&
npm install --global create-dmg &&
echo "- Creating DMG" &&
create-dmg build/StandaloneOSX/YARG.app --dmg-title=YARG
- if: ${{ inputs.createDmg == true }}
name: "[Post-build] Rename .dmg"
run: find . -name *.dmg -print -exec mv {} "YARG_v${{ inputs.version }}-MacOS-Universal.dmg" \;
- if: ${{ inputs.createDmg == true }}
name: "[Post-build] Upload .dmg to artifacts"
uses: actions/upload-artifact@v3
with:
name: YARG_v${{ inputs.version }}-MacOS-Universal.dmg
path: YARG_v${{ inputs.version }}-MacOS-Universal.dmg