This commit is contained in:
2025-05-27 12:20:09 +08:00
parent 5dacb966b0
commit 4097ed47f8
8 changed files with 162 additions and 138 deletions

48
.github/workflows/electron-build.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Build and Release Electron App
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.15.0'
- name: Install dependencies
run: npm install
- name: Build Electron app
run: npm run build
- name: Package Electron app (macOS)
if: matrix.os == 'macos-latest'
run: npm run build:mac
- name: Package Electron app (Windows)
if: matrix.os == 'windows-latest'
run: npm run build:win
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: |
build/*.dmg
build/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}