Skip to content

Commit b474db0

Browse files
authored
Implement multi-platform build and release workflow
This workflow builds and releases the application for multiple platforms including Android, Windows, macOS, and Linux.
1 parent 5ddcfde commit b474db0

File tree

1 file changed

+237
-0
lines changed

1 file changed

+237
-0
lines changed

.github/workflows/release.yml

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
name: Build and Release Multi-Platform
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
# ==========================================================
13+
# 1. ANDROID BUILD
14+
# ==========================================================
15+
build-android:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: ./Android
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Java
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: '17'
28+
29+
- name: Decode Keystore
30+
run: |
31+
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > app/release.keystore
32+
33+
- name: Build Release APK
34+
env:
35+
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
36+
SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
37+
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
38+
run: ./gradlew assembleRelease
39+
40+
- name: Rename APK
41+
run: |
42+
VERSION="${GITHUB_REF#refs/tags/}"
43+
mv app/build/outputs/apk/release/app-release.apk ../seamless-${VERSION}-android.apk
44+
45+
- name: Upload Artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: android-apk
49+
path: seamless-*-android.apk
50+
51+
# ==========================================================
52+
# 2. WINDOWS BUILD (x86_64)
53+
# ==========================================================
54+
build-windows:
55+
runs-on: windows-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: '3.10'
63+
64+
- name: Install Dependencies
65+
run: |
66+
pip install customtkinter pyinstaller
67+
68+
# Windows requires .ico. We convert the PNG to ICO on the fly.
69+
- name: Convert Icon to ICO
70+
run: |
71+
magick Assets/seamless.png -define icon:auto-resize=256,128,64,48,32,16 Assets/seamless.ico
72+
73+
- name: Build EXE
74+
run: |
75+
pyinstaller --onefile --noconsole --icon=Assets/seamless.ico seamless.py
76+
77+
- name: Rename
78+
shell: bash
79+
run: |
80+
VERSION="${GITHUB_REF#refs/tags/}"
81+
mv dist/seamless.exe seamless-${VERSION}-windows-x64.exe
82+
83+
- name: Upload Artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: windows-exe
87+
path: seamless-*-windows-x64.exe
88+
89+
# ==========================================================
90+
# 3. MACOS BUILD (Intel & Apple Silicon)
91+
# ==========================================================
92+
build-macos:
93+
name: build-macos-${{ matrix.architecture }}
94+
runs-on: ${{ matrix.os }}
95+
strategy:
96+
matrix:
97+
include:
98+
- os: macos-13
99+
architecture: x86_64
100+
- os: macos-14
101+
architecture: arm64
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@v5
107+
with:
108+
python-version: '3.10'
109+
110+
- name: Install Dependencies
111+
run: |
112+
pip install customtkinter pyinstaller
113+
brew install create-dmg
114+
115+
- name: Build App Bundle
116+
# FIXED: Pointing to Assets/seamless.icns
117+
run: |
118+
pyinstaller --onedir --windowed --icon=Assets/seamless.icns seamless.py
119+
120+
- name: Create DMG
121+
run: |
122+
VERSION="${GITHUB_REF#refs/tags/}"
123+
DMG_NAME="seamless-${VERSION}-macos-${{ matrix.architecture }}.dmg"
124+
125+
# FIXED: Pointing to Assets/seamless.icns for the volume icon
126+
create-dmg \
127+
--volname "Seamless" \
128+
--volicon "Assets/seamless.icns" \
129+
--window-pos 200 120 \
130+
--window-size 600 400 \
131+
--icon-size 120 \
132+
--icon "seamless.app" 150 200 \
133+
--app-drop-link 450 200 \
134+
"$DMG_NAME" \
135+
"dist/seamless.app"
136+
137+
- name: Zip DMG
138+
run: |
139+
VERSION="${GITHUB_REF#refs/tags/}"
140+
DMG_NAME="seamless-${VERSION}-macos-${{ matrix.architecture }}.dmg"
141+
zip "${DMG_NAME}.zip" "$DMG_NAME"
142+
143+
- name: Upload Artifact
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: macos-${{ matrix.architecture }}
147+
path: seamless-*.dmg.zip
148+
149+
# ==========================================================
150+
# 4. LINUX BUILD + Packaging
151+
# ==========================================================
152+
build-linux:
153+
runs-on: ubuntu-latest
154+
steps:
155+
- uses: actions/checkout@v4
156+
157+
- name: Install System Deps
158+
run: |
159+
sudo apt-get update
160+
sudo apt-get install -y python3-tk binutils ruby-dev build-essential
161+
sudo gem install fpm
162+
163+
- name: Set up Python
164+
uses: actions/setup-python@v5
165+
with:
166+
python-version: '3.10'
167+
168+
- name: Install Python Deps
169+
run: pip install customtkinter pyinstaller
170+
171+
- name: Build Binary
172+
# We assume seamless.png is 512x512 or similar high res
173+
run: pyinstaller --onefile seamless.py
174+
175+
- name: Prepare Variables
176+
id: vars
177+
run: |
178+
VERSION="${GITHUB_REF#refs/tags/}"
179+
CLEAN_VERSION="${VERSION#v}"
180+
echo "VERSION=$VERSION" >> $GITHUB_ENV
181+
echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV
182+
183+
- name: Package Tarball
184+
run: |
185+
mv dist/seamless seamless
186+
tar -czvf seamless-${{ env.VERSION }}-linux-x64.tar.gz seamless
187+
188+
# Package DEB (Debian/Ubuntu) - INCLUDES ICON
189+
- name: Package DEB
190+
run: |
191+
fpm -s dir -t deb -n seamless -v ${{ env.CLEAN_VERSION }} \
192+
--prefix /usr/local/bin \
193+
--description "Seamless File Transfer" \
194+
--deb-no-default-config-files \
195+
seamless
196+
197+
# Package RPM (RedHat/Fedora) - INCLUDES ICON
198+
- name: Package RPM
199+
run: |
200+
fpm -s dir -t rpm -n seamless -v ${{ env.CLEAN_VERSION }} \
201+
--prefix /usr/local/bin \
202+
--description "Seamless File Transfer" \
203+
seamless
204+
205+
- name: Rename Packages
206+
run: |
207+
mv seamless_*.deb seamless-${{ env.VERSION }}-linux-amd64.deb
208+
mv seamless-*.x86_64.rpm seamless-${{ env.VERSION }}-linux-x86_64.rpm
209+
210+
- name: Upload Artifacts
211+
uses: actions/upload-artifact@v4
212+
with:
213+
name: linux-packages
214+
path: |
215+
*.tar.gz
216+
*.deb
217+
*.rpm
218+
219+
# ==========================================================
220+
# 5. RELEASE
221+
# ==========================================================
222+
release:
223+
needs: [build-android, build-windows, build-macos, build-linux]
224+
runs-on: ubuntu-latest
225+
steps:
226+
- name: Download All Artifacts
227+
uses: actions/download-artifact@v4
228+
with:
229+
path: artifacts
230+
pattern: '*'
231+
merge-multiple: true
232+
233+
- name: Create GitHub Release
234+
uses: softprops/action-gh-release@v1
235+
with:
236+
files: artifacts/*
237+
generate_release_notes: true

0 commit comments

Comments
 (0)