-
-
Notifications
You must be signed in to change notification settings - Fork 222
206 lines (199 loc) · 10.3 KB
/
dev-desktop-builds.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: "dev-desktop-builds"
on:
push:
branches: [ master, material_maker_1_3 ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
sign_macos:
description: 'Sign macOS version'
type: boolean
required: true
default: 'false'
env:
GODOT_VERSION: 3.5.3
GODOT_SUB: stable
GODOT_DOWNLOAD_URL: https://github.com/godotengine/godot/releases/download
GODOT_MAC_HEADLESS_DOWNLOAD_URL: https://github.com/huskeee/godot-headless-mac/releases/download
EXPORT_NAME: material_maker
MM_RELEASE: 1_3
jobs:
export_windows_linux:
name: Export Windows and Linux 🗔
runs-on: ubuntu-latest
container:
image: docker://barichello/godot-ci:3.5
steps:
- name: Checkout 🛎️
uses: actions/checkout@v1
with:
submodules: true
- name: Setup 💻
run: |
wget -q ${GODOT_DOWNLOAD_URL}/${GODOT_VERSION}-${GODOT_SUB}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux_headless.64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux_headless.64.zip
wget -q ${GODOT_DOWNLOAD_URL}/${GODOT_VERSION}-${GODOT_SUB}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
unzip -a Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
mkdir -v -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_SUB}
mv ./templates/* ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_SUB}
dpkg --add-architecture i386 && apt-get update && apt-get install -y wine-stable && apt-get install -y wine32
ls -la /usr/bin
chown root:root -R ~
wget -q https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
mkdir -v -p ~/.local/share/rcedit
mv rcedit-x64.exe ~/.local/share/rcedit
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux_headless.64 -q
mkdir -p ~/.config/godot
cd ~/.local/share/rcedit
RCEDIT_PATH=`pwd`
cd -
echo '[gd_resource type="EditorSettings" format=2]' >> ~/.config/godot/editor_settings-3.tres
echo '[resource]' >> ~/.config/godot/editor_settings-3.tres
echo 'export/windows/wine = "/usr/bin/wine"' >> ~/.config/godot/editor_settings-3.tres
echo 'export/windows/rcedit = "'$RCEDIT_PATH'/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-3.tres
mkdir -v -p build/${EXPORT_NAME}_${MM_RELEASE}_windows build/${EXPORT_NAME}_${MM_RELEASE}_linux
- name: Generate Documentation
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "material_maker/doc"
- name: Windows Build 🗔
run: ./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux_headless.64 -v --export "Windows" ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/$EXPORT_NAME.exe
- name: Linux Build 🐧
run: ./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux_headless.64 -v --export "Linux/X11" ./build/${EXPORT_NAME}_${MM_RELEASE}_linux/$EXPORT_NAME.x86_64
- name: Copy Material Maker data 📁
run: |
cp -R ./addons/material_maker/nodes ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/environments ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/examples ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/library ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/meshes ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/misc/export ./build/${EXPORT_NAME}_${MM_RELEASE}_windows
cp -R ./material_maker/doc/_build/html ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/doc
cp -R ./addons/material_maker/nodes ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/environments ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/examples ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/library ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/meshes ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/misc/export ./build/${EXPORT_NAME}_${MM_RELEASE}_linux
cp -R ./material_maker/doc/_build/html ./build/${EXPORT_NAME}_${MM_RELEASE}_linux/doc
- name: Create archives 📁
run: |
cd build
zip -r ${EXPORT_NAME}_${MM_RELEASE}_windows.zip ${EXPORT_NAME}_${MM_RELEASE}_windows
tar zcvf ${EXPORT_NAME}_${MM_RELEASE}_linux.tar.gz ${EXPORT_NAME}_${MM_RELEASE}_linux
- name: Upload Documentation 🚀
uses: actions/upload-artifact@v3
with:
name: documentation
path: ./material_maker/doc/_build/html
- name: Upload Windows Artifact 🚀
uses: actions/upload-artifact@v3
with:
name: windows_snapshot
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_windows.zip
- name: Upload Linux Artifact 🚀
uses: actions/upload-artifact@v3
with:
name: linux_snapshot
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_linux.tar.gz
export-mac:
name: Mac Export 🍎
needs: export_windows_linux
runs-on: macos-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v1
with:
submodules: true
- name: Setup environment 🔧
run: |
export GODOT_VERSION=${GODOT_VERSION}-${GODOT_SUB}
export EXPORT_NAME=material_maker
- name: Install the Apple certificate and provisioning profile
if: ${{ github.event.inputs.sign_macos == 'true' }}
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN_PASSWORD }}"
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Download and extract export templates 💾
run: |
mkdir -v -p ~/.local/share/godot/templates/${GODOT_VERSION}.${GODOT_SUB}
wget -q ${GODOT_DOWNLOAD_URL}/${GODOT_VERSION}-${GODOT_SUB}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
ls -la
unzip -a Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
mv ./templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.${GODOT_SUB}
- name: Download Godot headless binary 🤖
run: |
wget -q ${GODOT_MAC_HEADLESS_DOWNLOAD_URL}/${GODOT_VERSION}-${GODOT_SUB}/Godot_${GODOT_VERSION}-${GODOT_SUB}_mac_headless.64.zip
- name: Setup 💻
run: mkdir -v -p ./build/mac
- name: Mac Build 🔧
run: |
chown runner bin/godot
chmod +x bin/godot
bin/godot -v --export "Mac OSX" ./build/mac/material_maker.zip
- name: Make application executable 🔧
run: |
unzip -a ./build/mac/material_maker.zip -d ./build/mac
chmod +x ./build/mac/material_maker.app/Contents/MacOS/material_maker
rm ./build/mac/material_maker.zip
- name: Fix application icon 🖼
run: sips -s format icns ./build/mac/material_maker.app/Contents/Resources/icon.icns --out ./build/mac/material_maker.app/Contents/Resources/icon.icns
- name: Get documentation 🚀
uses: actions/download-artifact@v3
with:
name: documentation
path: doc
- name: Copy data folder 📁
run: |
cp -R ./addons/material_maker/nodes ./build/mac/material_maker.app/Contents/MacOS
cp -R ./material_maker/environments ./build/mac/material_maker.app/Contents/MacOS
cp -R ./material_maker/examples ./build/mac/material_maker.app/Contents/MacOS
cp -R ./material_maker/library ./build/mac/material_maker.app/Contents/MacOS
cp -R ./material_maker/meshes ./build/mac/material_maker.app/Contents/MacOS
cp -R ./material_maker/misc/export ./build/mac/material_maker.app/Contents/MacOS
cp -R ./doc ./build/mac/material_maker.app/Contents/MacOS/doc
- name: Ad-hoc signing ✍️
if: ${{ github.event.inputs.sign_macos != 'true' }}
run: |
codesign -s - --force --deep ./build/mac/material_maker.app
- name: Signing ✍️
if: ${{ github.event.inputs.sign_macos == 'true' }}
run: |
codesign -s "Rodolphe Suescun" --force --options runtime --timestamp --deep ./build/mac/material_maker.app
- name: Create DMG archive 🔧
run: hdiutil create -srcfolder ./build/mac -fs HFS+ -volname material_maker ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg
- name: Notarizing ✍️
if: ${{ github.event.inputs.sign_macos == 'true' }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
NOTARYTOOL_APP_PASSWORD: ${{ secrets.NOTARYTOOL_APP_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
xcrun notarytool submit ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg --apple-id $APPLE_ID --password $NOTARYTOOL_APP_PASSWORD --team-id $APPLE_TEAM_ID --wait
xcrun stapler staple ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg
- name: Upload Mac OSX Artifact 🚀
uses: actions/upload-artifact@v3
with:
name: macos_snapshot
path: ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg