-
Notifications
You must be signed in to change notification settings - Fork 104
364 lines (314 loc) · 13.2 KB
/
Copy pathrelease.yml
File metadata and controls
364 lines (314 loc) · 13.2 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
name: CD - Release Build
on:
workflow_run:
workflows: ["CI - Build and Test"]
types: [completed]
branches: [main]
permissions:
contents: write
actions: read
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate Version
id: version
run: |
COUNT=$(git rev-list --count HEAD)
echo "version=0.1.${COUNT}" >> $GITHUB_OUTPUT
echo "Release version: v0.1.${COUNT}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ steps.version.outputs.version }}
name: Amplitron v${{ steps.version.outputs.version }}
body: |
## Amplitron v${{ steps.version.outputs.version }}
### Downloads
| Platform | File | Type |
|----------|------|------|
| **Windows** 10/11 (64-bit) | `Amplitron-Windows-Setup.exe` | Installer |
| **macOS** 10.15+ | `Amplitron-macOS.dmg` | Disk Image |
| **Linux** x64 | `Amplitron-Linux-x64.tar.gz` | Archive |
| **Android** 8.0+ (arm64 / x86_64) | `Amplitron-Android.apk` | APK (sideload) |
| **iOS** 15.0+ | `Amplitron-iOS.ipa` | Install via [AltStore](https://altstore.io) |
### Installation
**Windows**
1. Run `Amplitron-Windows-Setup.exe`
2. If SmartScreen appears, click **"More info"** → **"Run anyway"**
3. Follow the setup wizard — creates Start Menu & Desktop shortcuts
**macOS**
1. Open `Amplitron-macOS.dmg`, drag Amplitron to Applications
2. **First launch**: Right-click the app → **Open** → click **Open** in the dialog
3. Or run: `xattr -cr /Applications/Amplitron.app` then open normally
**Linux**
1. Extract the archive: `tar -xzf Amplitron-Linux-x64.tar.gz`
2. Run: `cd Amplitron-Linux && ./amplitron.sh`
> ⚠️ **Note**: Windows SmartScreen and macOS Gatekeeper warnings appear because the app is not yet code-signed with a paid certificate. The app is fully open-source — verify the code on GitHub.
**Website**: https://amplitron.sudipmondal.co.in
**Author**: Sudip Mondal (sudmondal2002@gmail.com)
package-windows:
name: Package Windows Installer
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download Windows Build
uses: actions/download-artifact@v8
with:
name: windows-build
path: artifacts/windows
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install NSIS
run: sudo apt-get update && sudo apt-get install -y nsis
- name: Prepare Files
run: |
mkdir -p staging
cp artifacts/windows/Amplitron.exe staging/Amplitron.exe
cp artifacts/windows/*.dll staging/ 2>/dev/null || true
cp README.md staging/
cp -r assets staging/ || true
ls -la staging/
- name: Build Installer
run: |
makensis "-DSRCDIR=$(pwd)/staging" "-DOUTFILE=$(pwd)/Amplitron-Windows-Setup.exe" scripts/installer.nsi
- name: Upload to Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.create-release.outputs.version }}
files: Amplitron-Windows-Setup.exe
package-macos:
name: Package macOS DMG
needs: create-release
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Download macOS Build
uses: actions/download-artifact@v8
with:
name: macos-build
path: artifacts/macos
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Create App Icon (icns)
run: |
mkdir -p icon.iconset
# Rasterize SVG to multiple sizes using sips
for size in 16 32 64 128 256 512; do
sips -z $size $size assets/favicon.ico --out icon.iconset/icon_${size}x${size}.png 2>/dev/null || true
done
# Generate from a 512px PNG as base
sips -s format png -z 512 512 assets/favicon.ico --out /tmp/icon_base.png 2>/dev/null || true
if [ -f /tmp/icon_base.png ]; then
for size in 16 32 64 128 256 512; do
sips -z $size $size /tmp/icon_base.png --out icon.iconset/icon_${size}x${size}.png
double=$((size * 2))
if [ $double -le 1024 ]; then
sips -z $double $double /tmp/icon_base.png --out icon.iconset/icon_${size}x${size}@2x.png
fi
done
iconutil -c icns icon.iconset -o icon.icns 2>/dev/null || true
fi
ls -la icon.icns 2>/dev/null || echo "icns generation failed, will skip icon"
- name: Create App Bundle
run: |
mkdir -p Amplitron.app/Contents/MacOS
mkdir -p Amplitron.app/Contents/Resources
mkdir -p Amplitron.app/Contents/Frameworks
# Copy binary
cp artifacts/macos/Amplitron Amplitron.app/Contents/MacOS/Amplitron
chmod +x Amplitron.app/Contents/MacOS/Amplitron
# Copy ALL bundled dylibs from CI
for dylib in artifacts/macos/*.dylib; do
[ -f "$dylib" ] || continue
libname=$(basename "$dylib")
echo "Copying dylib: $libname"
cp "$dylib" Amplitron.app/Contents/Frameworks/
chmod 644 "Amplitron.app/Contents/Frameworks/$libname"
done
# Rewrite binary rpaths: @executable_path/X -> @executable_path/../Frameworks/X
otool -L Amplitron.app/Contents/MacOS/Amplitron | tail -n +2 | awk '{print $1}' | while read -r lib; do
case "$lib" in
@executable_path/*)
libname=$(basename "$lib")
install_name_tool -change "$lib" "@executable_path/../Frameworks/$libname" Amplitron.app/Contents/MacOS/Amplitron
echo "Rewritten: $lib -> @executable_path/../Frameworks/$libname"
;;
esac
done
# Rewrite inter-dylib references in Frameworks
for fw in Amplitron.app/Contents/Frameworks/*.dylib; do
[ -f "$fw" ] || continue
libname=$(basename "$fw")
install_name_tool -id "@rpath/$libname" "$fw" 2>/dev/null || true
otool -L "$fw" | tail -n +2 | awk '{print $1}' | while read -r lib; do
case "$lib" in
@executable_path/*)
depname=$(basename "$lib")
install_name_tool -change "$lib" "@rpath/$depname" "$fw" 2>/dev/null || true
;;
esac
done
done
# Add rpath to binary so it finds Frameworks
install_name_tool -add_rpath @executable_path/../Frameworks Amplitron.app/Contents/MacOS/Amplitron 2>/dev/null || true
# Copy assets to Contents/Resources/ — SDL_GetBasePath() on macOS app bundles
# returns Contents/Resources/, not Contents/MacOS/, so the font loader finds:
# base_path + "assets/fonts/Roboto-Medium.ttf" = Contents/Resources/assets/fonts/...
cp -r assets Amplitron.app/Contents/Resources/assets || true
# Copy icon
cp icon.icns Amplitron.app/Contents/Resources/icon.icns 2>/dev/null || true
# Write Info.plist
VERSION="${{ needs.create-release.outputs.version }}"
/usr/libexec/PlistBuddy -c "Add :CFBundleExecutable string Amplitron" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleIdentifier string com.amplitron.app" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleName string Amplitron" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${VERSION}" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string ${VERSION}" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundlePackageType string APPL" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleIconFile string icon" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :NSHighResolutionCapable bool true" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :NSMicrophoneUsageDescription string 'Amplitron needs microphone access for guitar input.'" Amplitron.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :LSMinimumSystemVersion string 10.15" Amplitron.app/Contents/Info.plist
echo "=== Final binary links ==="
otool -L Amplitron.app/Contents/MacOS/Amplitron
echo "=== Frameworks ==="
ls -la Amplitron.app/Contents/Frameworks/
echo "=== Info.plist ==="
cat Amplitron.app/Contents/Info.plist
- name: Ad-hoc Codesign
run: |
# Sign each framework dylib first
for fw in Amplitron.app/Contents/Frameworks/*.dylib; do
[ -f "$fw" ] || continue
codesign --force --sign - "$fw"
done
# Then sign the whole app
codesign --force --deep --sign - Amplitron.app
# Verify
codesign --verify --verbose Amplitron.app
- name: Create DMG
run: |
mkdir -p dmg_staging
cp -r Amplitron.app dmg_staging/
ln -s /Applications dmg_staging/Applications
hdiutil create -volname "Amplitron" -srcfolder dmg_staging -ov -format UDZO Amplitron-macOS.dmg
- name: Upload to Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.create-release.outputs.version }}
files: Amplitron-macOS.dmg
package-linux:
name: Package Linux Archive
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download Linux Build
uses: actions/download-artifact@v8
with:
name: linux-build
path: artifacts/linux
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Package
run: |
mkdir -p Amplitron-Linux
cp artifacts/linux/Amplitron Amplitron-Linux/amplitron
chmod +x Amplitron-Linux/amplitron
cp README.md Amplitron-Linux/
cp -r assets Amplitron-Linux/ || true
printf '#!/bin/bash\ncd "$(dirname "$0")"\n./amplitron\n' > Amplitron-Linux/amplitron.sh
chmod +x Amplitron-Linux/amplitron.sh
tar -czf Amplitron-Linux-x64.tar.gz Amplitron-Linux
- name: Upload to Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.create-release.outputs.version }}
files: Amplitron-Linux-x64.tar.gz
package-android:
name: Package Android APK
needs: create-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download Android Build
uses: actions/download-artifact@v8
with:
name: android-build
path: artifacts/android
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rename APK
run: |
APK=$(find artifacts/android -name "*.apk" | head -1)
if [ -z "$APK" ]; then
echo "Error: No APK found in artifacts/android"
exit 1
fi
cp "$APK" Amplitron-Android.apk
ls -lh Amplitron-Android.apk
- name: Upload to Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.create-release.outputs.version }}
files: Amplitron-Android.apk
package-ios:
name: Package iOS IPA
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Download iOS Build
uses: actions/download-artifact@v8
with:
name: ios-build
path: artifacts/ios
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rename IPA
run: |
cp artifacts/ios/Amplitron.ipa Amplitron-iOS.ipa
ls -lh Amplitron-iOS.ipa
- name: Upload to Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.create-release.outputs.version }}
files: Amplitron-iOS.ipa
deploy-website:
name: Deploy Download Page + Web Demo
needs: [create-release, package-windows, package-macos, package-linux, package-android, package-ios]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download Web Build
uses: actions/download-artifact@v8
with:
name: web-build
path: web-demo
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Merge Web Demo into docs
run: |
mkdir -p docs/demo
if [ -d web-demo/build-web ]; then
cp web-demo/build-web/* docs/demo/ 2>/dev/null || true
elif [ -d web-demo ]; then
cp web-demo/*.html web-demo/*.js web-demo/*.wasm web-demo/*.data docs/demo/ 2>/dev/null || true
fi
echo "=== docs/demo contents ==="
ls -la docs/demo/ 2>/dev/null || echo "(empty)"
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_branch: gh-pages
keep_files: true