diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1942348..3e323d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 diff --git a/electron/scripts/linux-after-install.sh b/electron/scripts/linux-after-install.sh new file mode 100755 index 0000000..b713ca3 --- /dev/null +++ b/electron/scripts/linux-after-install.sh @@ -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 diff --git a/electron/scripts/linux-after-remove.sh b/electron/scripts/linux-after-remove.sh new file mode 100755 index 0000000..b713ca3 --- /dev/null +++ b/electron/scripts/linux-after-remove.sh @@ -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 diff --git a/package.json b/package.json index d719ecf..48b25e6 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,15 @@ } ], "win": { - "target": "nsis", + "target": [ + { + "target": "nsis", + "arch": [ + "x64", + "ia32" + ] + } + ], "icon": "dist/assets/icon.ico" }, "mac": { @@ -60,11 +68,30 @@ }, "linux": { "target": [ - "AppImage", - "deb" + { + "target": "AppImage", + "arch": [ + "x64", + "armv7l", + "arm64" + ] + }, + { + "target": "deb", + "arch": [ + "x64", + "armv7l", + "arm64" + ] + } ], + "category": "Utility", "maintainer": "AI Assistant " }, + "deb": { + "afterInstall": "electron/scripts/linux-after-install.sh", + "afterRemove": "electron/scripts/linux-after-remove.sh" + }, "nsis": { "oneClick": false, "allowToChangeInstallationDirectory": true