feat: update build process for Squirrel installer and add new upload steps
This commit is contained in:
@@ -100,17 +100,46 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload NSIS installer
|
||||
- name: Upload Squirrel Setup (x64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Paarrot-Windows-x64.exe
|
||||
path: dist-electron/Paarrot-*-win-x64.exe
|
||||
name: Paarrot-Setup-x64.exe
|
||||
path: dist-electron/Paarrot-*-win-x64-Setup.exe
|
||||
|
||||
- name: Upload Portable
|
||||
- name: Upload Squirrel Setup (arm64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Paarrot-Windows-x64-portable.exe
|
||||
path: dist-electron/Paarrot-*-win-x64.portable.exe
|
||||
name: Paarrot-Setup-arm64.exe
|
||||
path: dist-electron/Paarrot-*-win-arm64-Setup.exe
|
||||
|
||||
- name: List build output
|
||||
shell: powershell
|
||||
run: |
|
||||
Get-ChildItem -Path dist-electron -Recurse | Select-Object FullName
|
||||
|
||||
- name: Copy RELEASES file for upload
|
||||
shell: powershell
|
||||
run: |
|
||||
if (Test-Path \"dist-electron/squirrel-windows/RELEASES\") {
|
||||
Copy-Item \"dist-electron/squirrel-windows/RELEASES\" -Destination \"dist-electron/RELEASES\"
|
||||
} elseif (Test-Path \"dist-electron/RELEASES\") {
|
||||
Write-Output \"RELEASES file already at root\"
|
||||
} else {
|
||||
Write-Error \"RELEASES file not found\"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Upload Squirrel RELEASES
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: RELEASES
|
||||
path: dist-electron/RELEASES
|
||||
|
||||
- name: Upload Squirrel nupkg (x64)
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Paarrot-x64.nupkg
|
||||
path: dist-electron/Paarrot-*-win-x64-full.nupkg
|
||||
|
||||
- name: Upload Windows update metadata
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -240,7 +269,7 @@ jobs:
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
mkdir -p release-files
|
||||
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.rpm" -o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" \) -exec cp {} release-files/ \;
|
||||
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.rpm" -o -name "*.dmg" -o -name "*.zip" -o -name "*.yml" -o -name "*.nupkg" -o -name "RELEASES*" \) -exec cp {} release-files/ \;
|
||||
ls -la release-files/
|
||||
|
||||
- name: Create or Update Release
|
||||
|
||||
2
cinny
2
cinny
Submodule cinny updated: 495747af84...58966aec19
@@ -80,28 +80,24 @@
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": ["x64", "arm64"]
|
||||
},
|
||||
{
|
||||
"target": "portable",
|
||||
"target": "squirrel",
|
||||
"arch": ["x64", "arm64"]
|
||||
}
|
||||
],
|
||||
"icon": "icons/icon.ico",
|
||||
"artifactName": "${productName}-${version}-${os}-${arch}.${ext}"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"deleteAppDataOnUninstall": false,
|
||||
"squirrelWindows": {
|
||||
"name": "Paarrot",
|
||||
"loadingGif": "icons/icon.png",
|
||||
"iconUrl": "https://raw.githubusercontent.com/cinnyapp/cinny-desktop/master/icons/icon.ico",
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "Paarrot"
|
||||
"remoteReleases": false,
|
||||
"useAppIdAsId": true
|
||||
},
|
||||
"publish": {
|
||||
"provider": "generic",
|
||||
"url": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/${version}"
|
||||
"url": "http://synbox.ruv.wtf:8418/litruv/cinny-desktop/releases/download/v${version}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,63 @@ const PaarrotAPIServer = require('./api-server');
|
||||
const https = require('https');
|
||||
const http = require('http');
|
||||
|
||||
// Handle Squirrel events for Windows installer
|
||||
if (require('electron-squirrel-startup')) {
|
||||
app.quit();
|
||||
}
|
||||
|
||||
// Handle Squirrel.Windows installation/update events
|
||||
if (process.platform === 'win32') {
|
||||
const handleSquirrelEvent = () => {
|
||||
if (process.argv.length === 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const squirrelEvent = process.argv[1];
|
||||
|
||||
switch (squirrelEvent) {
|
||||
case '--squirrel-install':
|
||||
case '--squirrel-updated':
|
||||
// Install desktop and start menu shortcuts
|
||||
const cp = require('child_process');
|
||||
const updateDotExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
||||
const target = path.basename(process.execPath);
|
||||
const createShortcut = `${updateDotExe} --createShortcut=${target}`;
|
||||
|
||||
cp.exec(createShortcut, () => {
|
||||
app.quit();
|
||||
});
|
||||
return true;
|
||||
|
||||
case '--squirrel-uninstall':
|
||||
// Remove desktop and start menu shortcuts
|
||||
const cpUninstall = require('child_process');
|
||||
const updateDotExeUninstall = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
|
||||
const targetUninstall = path.basename(process.execPath);
|
||||
const removeShortcut = `${updateDotExeUninstall} --removeShortcut=${targetUninstall}`;
|
||||
|
||||
cpUninstall.exec(removeShortcut, () => {
|
||||
app.quit();
|
||||
});
|
||||
return true;
|
||||
|
||||
case '--squirrel-obsolete':
|
||||
// This is called on the outgoing version of your app before
|
||||
// we update to the new version - it's the opposite of
|
||||
// --squirrel-updated
|
||||
app.quit();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (handleSquirrelEvent()) {
|
||||
// Squirrel event handled and app will exit in 1000ms, so don't do anything else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const execAsync = promisify(exec);
|
||||
const store = new Store();
|
||||
|
||||
|
||||
29
package-lock.json
generated
29
package-lock.json
generated
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"name": "paarrot",
|
||||
"version": "4.11.5",
|
||||
"version": "4.11.20",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paarrot",
|
||||
"version": "4.11.5",
|
||||
"version": "4.11.20",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"body-parser": "2.2.2",
|
||||
"cors": "2.8.6",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"electron-store": "^8.2.0",
|
||||
"electron-updater": "^6.3.9",
|
||||
"express": "5.2.1",
|
||||
@@ -3388,6 +3389,30 @@
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-squirrel-startup": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.1.tgz",
|
||||
"integrity": "sha512-sTfFIHGku+7PsHLJ7v0dRcZNkALrV+YEozINTW8X1nM//e5O3L+rfYuvSW00lmGHnYmUjARZulD8F2V8ISI9RA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"debug": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-squirrel-startup/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-squirrel-startup/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-store": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-store/-/electron-store-8.2.0.tgz",
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"dependencies": {
|
||||
"body-parser": "2.2.2",
|
||||
"cors": "2.8.6",
|
||||
"electron-squirrel-startup": "^1.0.1",
|
||||
"electron-store": "^8.2.0",
|
||||
"electron-updater": "^6.3.9",
|
||||
"express": "5.2.1",
|
||||
|
||||
Reference in New Issue
Block a user