fix: update release workflow to include multiple OS targets and modify package.json for Linux x64 builds

This commit is contained in:
troyeguo
2025-08-12 09:27:30 +08:00
parent d8b7abe5f9
commit cf41e2bfd9
3 changed files with 32 additions and 6 deletions

View File

@@ -9,8 +9,7 @@ jobs:
# Platforms to build on/for
strategy:
matrix:
os: [ubuntu-24.04-arm]
# os: [macos-latest, ubuntu-latest, windows-latest]
os: [macos-latest, ubuntu-latest, windows-latest, ubuntu-24.04-arm]
steps:
- name: Check out Git repository
@@ -52,6 +51,21 @@ jobs:
run: echo "USE_SYSTEM_FPM=true" >> $GITHUB_ENV
- name: Set environment variable USE_HARD_LINKS
run: echo "USE_HARD_LINKS=false" >> $GITHUB_ENV
- name: Modify package.json for Linux arm64 build
if: startsWith(matrix.os, 'ubuntu-24.04-arm')
run: |
$packageJson = Get-Content package.json -Raw | ConvertFrom-Json
$packageJson.build.linux.target = @(
@{
target = "deb"
arch = @("arm64")
},
@{
target = "AppImage"
arch = @("arm64")
}
)
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1.6.0
with:

View File

@@ -159,7 +159,7 @@ const createMainWin = () => {
mainWin.loadURL(urlLocation);
mainWin.on("close", () => {
if (!mainWin.isDestroyed()) {
if (mainWin && !mainWin.isDestroyed()) {
let bounds = mainWin.getBounds();
if (bounds.width > 0 && bounds.height > 0) {
store.set({
@@ -233,7 +233,7 @@ const createMainWin = () => {
readerWindow.setAlwaysOnTop(true);
}
readerWindow.on("close", (event) => {
if (!readerWindow.isDestroyed()) {
if (readerWindow && !readerWindow.isDestroyed()) {
let bounds = readerWindow.getBounds();
if (bounds.width > 0 && bounds.height > 0) {
store.set({

View File

@@ -267,16 +267,28 @@
"icon": "assets/icons",
"category": "Office",
"target": [
{
"target": "snap",
"arch": [
"x64"
]
},
{
"target": "deb",
"arch": [
"arm64"
"x64"
]
},
{
"target": "rpm",
"arch": [
"x64"
]
},
{
"target": "AppImage",
"arch": [
"arm64"
"x64"
]
}
],