Skip to content

Commit 475a8fb

Browse files
committed
Rewrite CI workflow for Electron (v0.7.12)
Replace the old PyInstaller/Flet build with electron-builder: - Linux: npm run build-linux → AppImage - Windows: npm run build-win → NSIS installer (.exe) - macOS Intel (macos-13) + ARM (macos-latest): npm run build-mac → .dmg - Icons already present in assets/ (png/ico/icns) - CSC_IDENTITY_AUTO_DISCOVERY=false to skip code-signing on all platforms - Artifacts uploaded to GitHub Release on every v* tag push
1 parent 0030cc5 commit 475a8fb

1 file changed

Lines changed: 50 additions & 113 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,15 @@ jobs:
1818
include:
1919
- os: ubuntu-22.04
2020
platform: linux
21-
artifact_name: AutoNote-linux-x86_64.AppImage
2221

2322
- os: windows-latest
2423
platform: windows
25-
artifact_name: AutoNote-windows-x86_64.zip
2624

27-
- os: macos-12 # Intel (x86_64)
25+
- os: macos-13 # Intel (x86_64)
2826
platform: macos-intel
29-
artifact_name: AutoNote-macos-x86_64.zip
3027

31-
- os: macos-latest # Apple Silicon (arm64)
28+
- os: macos-latest # Apple Silicon (arm64)
3229
platform: macos-arm
33-
artifact_name: AutoNote-macos-arm64.zip
3430

3531
runs-on: ${{ matrix.os }}
3632
name: Build (${{ matrix.platform }})
@@ -39,140 +35,81 @@ jobs:
3935
# ── Checkout ────────────────────────────────────────────────────────────
4036
- uses: actions/checkout@v4
4137

42-
# ── Python ──────────────────────────────────────────────────────────────
43-
- name: Set up Python 3.11
44-
uses: actions/setup-python@v5
38+
# ── Node.js ─────────────────────────────────────────────────────────────
39+
- name: Set up Node.js
40+
uses: actions/setup-node@v4
4541
with:
46-
python-version: "3.11"
47-
cache: pip
48-
cache-dependency-path: requirements.txt
49-
50-
# ── Install build-time dependencies ─────────────────────────────────────
51-
# GUI + OpenAI + Anthropic clients are bundled. The heavy ML stack
52-
# (torch, faster-whisper, etc.) is NOT bundled; users run it separately.
53-
# The app auto-falls back to OpenAI Whisper API when faster-whisper is absent.
54-
- name: Install dependencies
55-
run: |
56-
pip install --upgrade pip
57-
pip install -r requirements.txt
42+
node-version: '20'
43+
cache: 'npm'
44+
cache-dependency-path: electron/package-lock.json
5845

59-
# ── Linux: install system libs required by flet/webkit ──────────────────
46+
# ── Linux: system libs required by Electron / AppImage ──────────────────
6047
- name: Install Linux system deps
6148
if: matrix.platform == 'linux'
6249
run: |
6350
sudo apt-get update -qq
6451
sudo apt-get install -y --no-install-recommends \
65-
libgtk-3-dev libwebkit2gtk-4.0-dev \
66-
libglib2.0-dev \
67-
fuse libfuse2
68-
69-
# ── Generate app icons (Linux / macOS) ───────────────────────────────────
70-
- name: Generate icons (Linux / macOS)
71-
if: matrix.platform != 'windows'
72-
run: python make_icon.py
52+
libgtk-3-dev libglib2.0-dev fuse libfuse2 rpm
7353
74-
# ── Generate app icons (Windows) ─────────────────────────────────────────
75-
- name: Generate icons (Windows)
76-
if: matrix.platform == 'windows'
77-
run: python make_icon.py
78-
shell: pwsh
54+
# ── Install npm dependencies ─────────────────────────────────────────────
55+
- name: Install npm dependencies
56+
working-directory: electron
57+
run: npm install
7958

80-
# ── Build with PyInstaller ───────────────────────────────────────────────
81-
- name: Build (Linux / macOS)
82-
if: matrix.platform != 'windows'
83-
run: pyinstaller build.spec --noconfirm
59+
# ── Build ────────────────────────────────────────────────────────────────
60+
- name: Build (Linux)
61+
if: matrix.platform == 'linux'
62+
working-directory: electron
63+
run: npm run build-linux
64+
env:
65+
# Disable code-signing; we ship unsigned builds
66+
CSC_IDENTITY_AUTO_DISCOVERY: false
8467

8568
- name: Build (Windows)
8669
if: matrix.platform == 'windows'
87-
run: pyinstaller build.spec --noconfirm
88-
shell: pwsh
89-
90-
# ── Linux: wrap dist/AutoNote directory into an AppImage ─────────────────
91-
- name: Create AppImage (Linux)
92-
if: matrix.platform == 'linux'
93-
run: |
94-
# Download appimagetool
95-
wget -q -O appimagetool \
96-
"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
97-
chmod +x appimagetool
98-
99-
# Build AppDir layout
100-
mkdir -p AppDir/usr/bin AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/256x256/apps
101-
102-
# Copy the PyInstaller output
103-
cp -r dist/AutoNote/* AppDir/usr/bin/
104-
105-
# Desktop entry
106-
cat > AppDir/AutoNote.desktop << 'EOF'
107-
[Desktop Entry]
108-
Name=AutoNote
109-
Comment=AI lecture note pipeline
110-
Exec=AutoNote
111-
Icon=AutoNote
112-
Type=Application
113-
Categories=Education;Science;
114-
Terminal=false
115-
EOF
116-
117-
cp AppDir/AutoNote.desktop AppDir/usr/share/applications/
118-
119-
# Placeholder icon (replace with real icon if available)
120-
if [ -f assets/icon.png ]; then
121-
cp assets/icon.png AppDir/usr/share/icons/hicolor/256x256/apps/AutoNote.png
122-
cp assets/icon.png AppDir/AutoNote.png
123-
else
124-
# Generate a minimal valid PNG so appimagetool doesn't fail
125-
python3 -c "
126-
import struct, zlib, base64
127-
# 1x1 cyan PNG
128-
png = base64.b64decode(
129-
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==')
130-
open('AppDir/AutoNote.png','wb').write(png)
131-
open('AppDir/usr/share/icons/hicolor/256x256/apps/AutoNote.png','wb').write(png)
132-
"
133-
fi
134-
135-
# AppStream symlink expected by some tools
136-
ln -sf usr/bin/AutoNote AppDir/AppRun
137-
138-
# Package
139-
ARCH=x86_64 ./appimagetool AppDir AutoNote-linux-x86_64.AppImage
140-
141-
# ── Windows: zip the dist directory ─────────────────────────────────────
142-
- name: Package (Windows)
143-
if: matrix.platform == 'windows'
144-
run: Compress-Archive -Path dist\AutoNote -DestinationPath AutoNote-windows-x86_64.zip
145-
shell: pwsh
70+
working-directory: electron
71+
run: npm run build-win
72+
env:
73+
CSC_IDENTITY_AUTO_DISCOVERY: false
14674

147-
# ── macOS Intel: zip the .app bundle ─────────────────────────────────────
148-
- name: Package (macOS Intel)
75+
- name: Build (macOS Intel)
14976
if: matrix.platform == 'macos-intel'
150-
run: |
151-
cd dist
152-
zip -r ../AutoNote-macos-x86_64.zip AutoNote.app
77+
working-directory: electron
78+
run: npm run build-mac
79+
env:
80+
CSC_IDENTITY_AUTO_DISCOVERY: false
15381

154-
# ── macOS ARM: zip the .app bundle ───────────────────────────────────────
155-
- name: Package (macOS ARM)
82+
- name: Build (macOS ARM)
15683
if: matrix.platform == 'macos-arm'
157-
run: |
158-
cd dist
159-
zip -r ../AutoNote-macos-arm64.zip AutoNote.app
84+
working-directory: electron
85+
run: npm run build-mac
86+
env:
87+
CSC_IDENTITY_AUTO_DISCOVERY: false
16088

161-
# ── Upload artifact for debugging (optional) ─────────────────────────────
89+
# ── Upload artifact for debugging ────────────────────────────────────────
16290
- name: Upload build artifact
16391
uses: actions/upload-artifact@v4
16492
with:
165-
name: ${{ matrix.artifact_name }}
166-
path: ${{ matrix.artifact_name }}
93+
name: build-${{ matrix.platform }}
94+
path: |
95+
electron/dist/*.AppImage
96+
electron/dist/*.exe
97+
electron/dist/*.dmg
98+
electron/dist/*.zip
99+
if-no-files-found: warn
167100
retention-days: 7
168101

169102
# ── Attach to GitHub Release ─────────────────────────────────────────────
170103
- name: Upload to Release
171104
uses: softprops/action-gh-release@v2
172105
with:
173-
files: ${{ matrix.artifact_name }}
106+
files: |
107+
electron/dist/*.AppImage
108+
electron/dist/*.exe
109+
electron/dist/*.dmg
110+
electron/dist/*.zip
174111
generate_release_notes: true
175112
draft: false
176-
prerelease: ${{ contains(github.ref_name, '-') }} # v1.0.0-beta → prerelease
113+
prerelease: ${{ contains(github.ref_name, '-') }}
177114
env:
178115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)