diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 80eda00..f0d7111 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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 diff --git a/dev-app-update.yml b/dev-app-update.yml new file mode 100644 index 0000000..200a688 --- /dev/null +++ b/dev-app-update.yml @@ -0,0 +1,4 @@ +provider: github +owner: Paarrot +repo: Paarrot-Desktop +updaterCacheDirName: paarrot-updater diff --git a/electron-builder.json5 b/electron-builder.json5 index 659dd13..e727798 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -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}", diff --git a/electron/main.js b/electron/main.js index fd61c41..85b7464 100644 --- a/electron/main.js +++ b/electron/main.js @@ -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) { diff --git a/package.json b/package.json index 926cc6b..006888e 100644 --- a/package.json +++ b/package.json @@ -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"