feat: enhance build process and add local build scripts for Windows and Linux
This commit is contained in:
@@ -96,7 +96,7 @@ jobs:
|
||||
if (Test-Path dist-electron) { Remove-Item -Recurse -Force dist-electron }
|
||||
|
||||
- name: Build Electron app
|
||||
run: npm run build:win
|
||||
run: npm run build:local -- --win
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GHTOKEN }}
|
||||
|
||||
@@ -166,7 +166,7 @@ jobs:
|
||||
rm -rf cinny/dist dist-electron
|
||||
|
||||
- name: Build Electron app
|
||||
run: npm run build:linux
|
||||
run: npm run build:local -- --linux
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GHTOKEN }}
|
||||
|
||||
@@ -175,6 +175,12 @@ jobs:
|
||||
with:
|
||||
name: Paarrot-Linux-x64.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:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -232,7 +238,7 @@ jobs:
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
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/
|
||||
|
||||
- name: Create or Update Release
|
||||
|
||||
4
dev-app-update.yml
Normal file
4
dev-app-update.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
provider: github
|
||||
owner: Paarrot
|
||||
repo: Paarrot-Desktop
|
||||
updaterCacheDirName: paarrot-updater
|
||||
@@ -10,6 +10,7 @@
|
||||
"files": [
|
||||
"electron/**/*",
|
||||
"cinny/dist/**/*",
|
||||
"dev-app-update.yml",
|
||||
"!**/*.map",
|
||||
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
|
||||
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
|
||||
|
||||
@@ -86,6 +86,20 @@ app.setName('Paarrot');
|
||||
autoUpdater.autoDownload = false;
|
||||
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', () => {
|
||||
console.log('Checking for updates...');
|
||||
if (mainWindow) {
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
"version": "4.11.90",
|
||||
"description": "Paarrot - A Matrix client based on Cinny",
|
||||
"homepage": "https://github.com/Paarrot/Paarrot-Desktop",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Paarrot/Paarrot-Desktop.git"
|
||||
},
|
||||
"main": "electron/main.js",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
@@ -12,6 +16,7 @@
|
||||
"dev:vite": "cd cinny && npm start",
|
||||
"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: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:win": "npm run build -- --win",
|
||||
"postman:generate": "node scripts/generate-postman-collection.js"
|
||||
|
||||
Reference in New Issue
Block a user