Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,36 @@ on:

jobs:
build:
name: Build on ${{ matrix.os }}
name: Build on ${{ matrix.display_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: macos-latest
display_name: macOS x64
build_command: npx electron-builder --publish never --mac
artifact_name: macOS-artifacts
- os: windows-latest
display_name: Windows x64
build_command: npx electron-builder --publish never --win --x64
artifact_name: windows-x64-artifacts
- os: windows-latest
display_name: Windows ia32
build_command: npx electron-builder --publish never --win --ia32
artifact_name: windows-ia32-artifacts
- os: ubuntu-latest
display_name: Linux x64
build_command: npx electron-builder --publish never --linux --x64
artifact_name: linux-x64-artifacts
- os: ubuntu-latest
display_name: Linux armv7l
build_command: npx electron-builder --publish never --linux --armv7l
artifact_name: linux-armv7l-artifacts
- os: ubuntu-latest
display_name: Linux arm64
build_command: npx electron-builder --publish never --linux --arm64
artifact_name: linux-arm64-artifacts

steps:
- name: Checkout repository
Expand All @@ -33,12 +57,12 @@ jobs:
run: npm run build

- name: Package Electron application
run: npx electron-builder --publish never
run: ${{ matrix.build_command }}

- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-artifacts
name: ${{ matrix.artifact_name }}
path: release/**
if-no-files-found: error
12 changes: 12 additions & 0 deletions electron/scripts/linux-after-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database >/usr/share/applications >/dev/null 2>&1 || true
fi

if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -f -q /usr/share/icons/hicolor || true
fi

exit 0
12 changes: 12 additions & 0 deletions electron/scripts/linux-after-remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e

if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database >/usr/share/applications >/dev/null 2>&1 || true
fi

if command -v gtk-update-icon-cache >/dev/null 2>&1; then
gtk-update-icon-cache -f -q /usr/share/icons/hicolor || true
fi

exit 0
33 changes: 30 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,46 @@
}
],
"win": {
"target": "nsis",
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
],
"icon": "dist/assets/icon.ico"
},
"mac": {
"target": "dmg"
},
"linux": {
"target": [
"AppImage",
"deb"
{
"target": "AppImage",
"arch": [
"x64",
"armv7l",
"arm64"
]
},
{
"target": "deb",
"arch": [
"x64",
"armv7l",
"arm64"
]
}
],
"category": "Utility",
"maintainer": "AI Assistant <support@example.com>"
},
"deb": {
"afterInstall": "electron/scripts/linux-after-install.sh",
"afterRemove": "electron/scripts/linux-after-remove.sh"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
Expand Down