@@ -149,17 +149,128 @@ jobs:
149
149
shell : bash
150
150
working-directory : aseprite
151
151
run : ninja -C build
152
-
152
+
153
153
- name : Clean Up Build folder
154
154
shell : bash
155
155
working-directory : aseprite/build/bin
156
156
run : find . -mindepth 1 ! \( -name 'aseprite' -o -name 'aseprite.exe' -o -name 'data' -prune \) -exec rm -rf {} +
157
-
157
+
158
158
- name : Make portable zip
159
159
working-directory : aseprite/build/bin
160
160
run : echo '# This file is here so Aseprite behaves as a portable program' > aseprite.ini
161
+
162
+ - name : Download and extract OpenSSL DLLs (Windows)
163
+ if : runner.os == 'Windows'
164
+ shell : pwsh
165
+ working-directory : aseprite/build/bin
166
+ run : |
167
+ # Download the zip from https://wiki.overbyte.eu/wiki/index.php/ICS_Download
168
+ # This binary provider comes from a suggested 3rd party list on the official opensll github
169
+ Invoke-WebRequest -Uri "https://wiki.overbyte.eu/arch/openssl-1.1.1w-win64.zip" -OutFile dlls.zip
170
+
171
+ # Extract dlls into same path as the .exe
172
+ Expand-Archive -Path dlls.zip -DestinationPath temp_dlls
173
+ Copy-Item temp_dlls\libcrypto-1_1-x64.dll .
174
+ Copy-Item temp_dlls\libssl-1_1-x64.dll .
175
+
176
+ # Remove the ssl zip + temp folder from the final release
177
+ Remove-Item -Recurse -Force temp_dlls
178
+ Remove-Item dlls.zip
179
+
180
+ - name : Create macOS .app bundle
181
+ if : runner.os == 'macOS'
182
+ shell : bash
183
+ working-directory : aseprite/build/bin
184
+ run : |
185
+ mkdir -p Aseprite.app/Contents/MacOS
186
+ mkdir -p Aseprite.app/Contents/Resources
187
+
188
+ # Move the built binary into the app bundle
189
+ mv aseprite Aseprite.app/Contents/MacOS/
190
+ mv data Aseprite.app/Contents/Resources/
191
+ # Don't know if ini is needed on mac
192
+ mv aseprite.ini Aseprite.app/Contents/Resources/
193
+
194
+ # Create app icns
195
+ mkdir -p Aseprite.iconset
196
+ for file in Aseprite.app/Contents/Resources/data/icons/ase*.png; do
197
+ num=$(basename "$file" | grep -E -o "\d+")
198
+ if (( num % 16 == 0 )); then
199
+ cp "$file" "Aseprite.iconset/icon_${num}x${num}.png"
200
+ fi
201
+ done
202
+ iconutil -c icns Aseprite.iconset
203
+ rm -R Aseprite.iconset
204
+ mv Aseprite.icns Aseprite.app/Contents/Resources/
205
+
206
+ # Create minimal Info.plist
207
+ cat > Aseprite.app/Contents/Info.plist <<EOF
208
+ <?xml version="1.0" encoding="UTF-8"?>
209
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
210
+ <plist version="1.0">
211
+ <dict>
212
+ <key>CFBundleExecutable</key>
213
+ <string>aseprite</string>
214
+ <key>CFBundleIdentifier</key>
215
+ <string>org.aseprite.app</string>
216
+ <key>CFBundleName</key>
217
+ <string>Aseprite</string>
218
+ <key>CFBundleVersion</key>
219
+ <string>${{ needs.create-release.outputs.release-tag }}</string>
220
+ <key>CFBundlePackageType</key>
221
+ <string>APPL</string>
222
+ <key>CFBundleIconFile</key>
223
+ <string>Aseprite.icns</string>
224
+ </dict>
225
+ </plist>
226
+ EOF
227
+
228
+ - name : Create release (macOS)
229
+ if : runner.os == 'macOS'
230
+ shell : bash
231
+ working-directory : aseprite/build/bin
232
+ run : |
233
+ # Create the folder to hold the .app and the helper script
234
+ mkdir AsepriteBundle
235
+ mv Aseprite.app AsepriteBundle/
236
+
237
+ # Need to overcome mac security for external unsigned apps
238
+ # https://github.com/electron-userland/electron-builder/issues/8191
239
+ cat << 'EOF' > AsepriteBundle/README.md
240
+ # Fixing "damaged and can't be opened" on macOS
241
+
242
+ If you see an error saying Aseprite is “damaged and can’t be opened,” this is caused by macOS quarantine flags applied when downloading from the internet.
243
+
244
+ Follow these steps to fix it:
245
+
246
+ 1. Open Terminal:
247
+ - Press Command + Spacebar
248
+ - Type "Terminal" and press Enter
249
+
250
+ 2. In the Terminal window, type the word `cd` followed by a space, then drag the folder containing this app into the Terminal window. This will insert the folder path.
251
+
252
+ Example:
253
+ cd /Users/yourname/Downloads/AsepriteBundle
254
+
255
+ 3. Press Enter
256
+
257
+ 4. Copy and paste the following line
258
+ xattr -rd com.apple.quarantine Aseprite.app
259
+
260
+ 5. Press Enter
261
+
262
+ After that, you should be able to double-click Aseprite.app and open it normally.
263
+
264
+ You only need to do this once after downloading.
265
+
266
+ EOF
267
+
268
+ # Create the zip, preserving metadata
269
+ ditto -c -k --sequesterRsrc --keepParent AsepriteBundle Aseprite-${{ needs.create-release.outputs.release-tag }}-${{ runner.os }}.zip
270
+
161
271
162
- - name : Create release
272
+ - name : Create release (Linux + Windows)
273
+ if : runner.os != 'macOS'
163
274
working-directory : aseprite/build/bin
164
275
run : 7z -tzip a Aseprite-${{ needs.create-release.outputs.release-tag }}-${{ runner.os }}.zip *
165
276
0 commit comments