feat: enhance build process and add local build scripts for Windows and Linux

This commit is contained in:
2026-04-22 03:53:50 +10:00
parent 21e895efff
commit b8a126fd69
5 changed files with 33 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ jobs:
if (Test-Path dist-electron) { Remove-Item -Recurse -Force dist-electron } if (Test-Path dist-electron) { Remove-Item -Recurse -Force dist-electron }
- name: Build Electron app - name: Build Electron app
run: npm run build:win run: npm run build:local -- --win
env: env:
GH_TOKEN: ${{ secrets.GHTOKEN }} GH_TOKEN: ${{ secrets.GHTOKEN }}
@@ -166,7 +166,7 @@ jobs:
rm -rf cinny/dist dist-electron rm -rf cinny/dist dist-electron
- name: Build Electron app - name: Build Electron app
run: npm run build:linux run: npm run build:local -- --linux
env: env:
GH_TOKEN: ${{ secrets.GHTOKEN }} GH_TOKEN: ${{ secrets.GHTOKEN }}
@@ -175,6 +175,12 @@ jobs:
with: with:
name: Paarrot-Linux-x64.AppImage name: Paarrot-Linux-x64.AppImage
path: dist-electron/Paarrot-*.AppImage path: dist-electron/Paarrot-*.AppImage
- name: Upload latest-linux.yml
uses: actions/upload-artifact@v3
with:
name: latest-linux.yml
path: dist-electron/latest-linux.yml
create-release: create-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -232,7 +238,7 @@ jobs:
- name: Prepare release files - name: Prepare release files
run: | run: |
mkdir -p release-files mkdir -p release-files
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.nupkg" -o -name "RELEASES*" \) -exec cp {} release-files/ \; find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.nupkg" -o -name "RELEASES*" -o -name "*.yml" \) -exec cp {} release-files/ \;
ls -la release-files/ ls -la release-files/
- name: Create or Update Release - name: Create or Update Release

4
dev-app-update.yml Normal file
View File

@@ -0,0 +1,4 @@
provider: github
owner: Paarrot
repo: Paarrot-Desktop
updaterCacheDirName: paarrot-updater

View File

@@ -10,6 +10,7 @@
"files": [ "files": [
"electron/**/*", "electron/**/*",
"cinny/dist/**/*", "cinny/dist/**/*",
"dev-app-update.yml",
"!**/*.map", "!**/*.map",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}", "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}", "!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",

View File

@@ -86,6 +86,20 @@ app.setName('Paarrot');
autoUpdater.autoDownload = false; autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true; autoUpdater.autoInstallOnAppQuit = true;
// Set feed URL manually as fallback if app-update.yml is missing
if (!isDev) {
try {
autoUpdater.setFeedURL({
provider: 'github',
owner: 'Paarrot',
repo: 'Paarrot-Desktop',
releaseType: 'release'
});
} catch (err) {
console.warn('Failed to set feed URL:', err);
}
}
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
console.log('Checking for updates...'); console.log('Checking for updates...');
if (mainWindow) { if (mainWindow) {

View File

@@ -3,6 +3,10 @@
"version": "4.11.90", "version": "4.11.90",
"description": "Paarrot - A Matrix client based on Cinny", "description": "Paarrot - A Matrix client based on Cinny",
"homepage": "https://github.com/Paarrot/Paarrot-Desktop", "homepage": "https://github.com/Paarrot/Paarrot-Desktop",
"repository": {
"type": "git",
"url": "https://github.com/Paarrot/Paarrot-Desktop.git"
},
"main": "electron/main.js", "main": "electron/main.js",
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
@@ -12,6 +16,7 @@
"dev:vite": "cd cinny && npm start", "dev:vite": "cd cinny && npm start",
"dev:electron": "wait-on http://localhost:38347 && cross-env NODE_ENV=development electron .", "dev:electron": "wait-on http://localhost:38347 && cross-env NODE_ENV=development electron .",
"build": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder --publish always", "build": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder --publish always",
"build:local": "node -e \"require('fs').copyFileSync('config.json', 'cinny/config.json')\" && cd cinny && npm run build && cd .. && electron-builder",
"build:linux": "npm run build -- --linux", "build:linux": "npm run build -- --linux",
"build:win": "npm run build -- --win", "build:win": "npm run build -- --win",
"postman:generate": "node scripts/generate-postman-collection.js" "postman:generate": "node scripts/generate-postman-collection.js"