-
-
Notifications
You must be signed in to change notification settings - Fork 224
216 lines (209 loc) · 11.4 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
207
208
209
210
211
212
213
214
215
216
name: "dev-desktop-builds"
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
inputs:
sign_macos:
description: "Sign macOS version"
type: boolean
required: true
default: "false"
gen_doc:
description: "Generate documentation"
type: boolean
required: true
default: "true"
env:
GODOT_VERSION: 4.4
GODOT_SUB: dev6
GODOT_DOWNLOAD_DIR: https://github.com/godotengine/godot-builds/releases/download/4.4-dev6
EXPORT_NAME: material_maker
MM_RELEASE: 1_4a2
jobs:
export_windows_linux:
name: Export Windows and Linux 🗔
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v1
with:
submodules: true
- name: Setup 💻
run: |
wget -q ${GODOT_DOWNLOAD_DIR}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64.zip
wget -q ${GODOT_DOWNLOAD_DIR}/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}
sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install -y wine-stable && sudo apt-get install -y wine32
#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}-stable_linux.x86_64 --headless -q
mkdir -p ~/.config/godot
cd ~/.local/share/rcedit
RCEDIT_PATH=`pwd`
cd -
echo '[gd_resource type="EditorSettings" format=2]' >> ~/.config/godot/editor_settings-4.tres
echo '[resource]' >> ~/.config/godot/editor_settings-4.tres
echo 'export/windows/wine = "/usr/bin/wine"' >> ~/.config/godot/editor_settings-4.tres
echo 'export/windows/rcedit = "'$RCEDIT_PATH'/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-4.tres
mkdir -v -p build/${EXPORT_NAME}_${MM_RELEASE}_windows build/${EXPORT_NAME}_${MM_RELEASE}_linux
- name: Generate Documentation
if: ${{ github.event.inputs.gen_doc == 'true' }}
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "material_maker/doc"
- name: Windows Build 🗔
run: |
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Windows" ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/$EXPORT_NAME.exe
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Windows" ./build/${EXPORT_NAME}_${MM_RELEASE}_windows/$EXPORT_NAME.exe
- name: Linux Build 🐧
run: |
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "Linux/X11" ./build/${EXPORT_NAME}_${MM_RELEASE}_linux/$EXPORT_NAME.x86_64
./Godot_v${GODOT_VERSION}-${GODOT_SUB}_linux.x86_64 --headless -v --export-release "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 🚀
if: ${{ github.event.inputs.gen_doc == 'true' }}
uses: actions/upload-artifact@v4
with:
name: documentation
path: ./material_maker/doc/_build/html
- name: Upload Windows Artifact 🚀
uses: actions/upload-artifact@v4
with:
name: windows_snapshot
path: build/${{ env.EXPORT_NAME }}_${{ env.MM_RELEASE }}_windows.zip
- name: Upload Linux Artifact 🚀
uses: actions/upload-artifact@v4
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}
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 Godot and export templates 💾
run: |
wget ${GODOT_DOWNLOAD_DIR}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_macos.universal.zip
unzip -a Godot_v${GODOT_VERSION}-${GODOT_SUB}_macos.universal.zip
wget ${GODOT_DOWNLOAD_DIR}/Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
unzip -a Godot_v${GODOT_VERSION}-${GODOT_SUB}_export_templates.tpz
mkdir -v -p "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_SUB}"
mv ./templates/* "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_SUB}"
- name: Mac Build 🔧
run: |
chown runner Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
mkdir -v -p ./build/mac
Godot.app/Contents/MacOS/Godot --headless -v --export-release "Mac OSX" ./build/mac/material_maker.zip
Godot.app/Contents/MacOS/Godot --headless -v --export-release "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 🚀
if: ${{ github.event.inputs.gen_doc == 'true' }}
uses: actions/download-artifact@v4
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 material_maker_${{ env.MM_RELEASE }}.dmg
wget https://github.com/create-dmg/create-dmg/archive/refs/tags/v1.2.2.zip
unzip v1.2.2.zip
create-dmg-1.2.2/create-dmg --volname "Material Maker" --icon-size 128 --background splash_screen/backgrounds/pavel_oliva_vintage_luggage.png --window-size 540 330 --icon "Material Maker.app" 158 125 --app-drop-link 384 125 --hide-extension "Material Maker.app" ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg ./build/mac
- 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@v4
with:
name: macos_snapshot
path: ./build/mac/material_maker_${{ env.MM_RELEASE }}.dmg