electron-builder auto-publishes in CI without GH_TOKEN, causing failure. Also remove redundant Windows arch matrix since NSIS bundles both x64 and arm64 in a single installer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
112 lines
2.7 KiB
YAML
112 lines
2.7 KiB
YAML
name: Build & Package
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
platform:
|
|
description: "Target platform"
|
|
required: true
|
|
default: "all"
|
|
type: choice
|
|
options:
|
|
- all
|
|
- windows
|
|
- macos
|
|
- linux
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
build-windows:
|
|
if: ${{ github.event_name == 'push' || inputs.platform == 'all' || inputs.platform == 'windows' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Electron app
|
|
run: npm run electron:build
|
|
|
|
- name: Package for Windows
|
|
run: npx electron-builder --win --config electron-builder.yml --publish never
|
|
|
|
- name: Upload Windows artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows
|
|
path: |
|
|
release/*.exe
|
|
release/*.zip
|
|
if-no-files-found: warn
|
|
|
|
build-macos:
|
|
if: ${{ github.event_name == 'push' || inputs.platform == 'all' || inputs.platform == 'macos' }}
|
|
runs-on: macos-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [x64, arm64]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Electron app
|
|
run: npm run electron:build
|
|
|
|
- name: Package for macOS (${{ matrix.arch }})
|
|
run: npx electron-builder --mac --${{ matrix.arch }} --config electron-builder.yml --publish never
|
|
|
|
- name: Upload macOS artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-${{ matrix.arch }}
|
|
path: release/*.dmg
|
|
if-no-files-found: warn
|
|
|
|
build-linux:
|
|
if: ${{ github.event_name == 'push' || inputs.platform == 'all' || inputs.platform == 'linux' }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
arch: [x64, arm64]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Electron app
|
|
run: npm run electron:build
|
|
|
|
- name: Package for Linux (${{ matrix.arch }})
|
|
run: npx electron-builder --linux --${{ matrix.arch }} --config electron-builder.yml --publish never
|
|
|
|
- name: Upload Linux artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-${{ matrix.arch }}
|
|
path: |
|
|
release/*.AppImage
|
|
release/*.deb
|
|
release/*.rpm
|
|
if-no-files-found: warn
|