From 72f0f1a318a04e384940e849b29534d9cf8b9313 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" <mrstallion@nobody.nowhere.fauxdomain.ext> Date: Sun, 3 Sep 2023 15:24:08 -0700 Subject: [PATCH] minor --- README.md | 11 ++-- electron/pack.js | 63 +++++++++++++++------- electron/release-scripts/windows-canary.sh | 13 +++++ electron/release-scripts/windows.sh | 24 +++++++++ 4 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 electron/release-scripts/windows-canary.sh create mode 100644 electron/release-scripts/windows.sh diff --git a/README.md b/README.md index 8d788b7..2e3fcda 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Download -[Windows](https://github.com/hearmeneigh/fchat-rising/releases/download/v1.24.0/F-Chat-Rising-1.24.0-win.exe) (82 MB) -| [MacOS Intel](https://github.com/hearmeneigh/fchat-rising/releases/download/v1.24.0/F-Chat-Rising-1.24.0-macos-intel.dmg) (82 MB) -| [MacOS M1](https://github.com/hearmeneigh/fchat-rising/releases/download/v1.24.0/F-Chat-Rising-1.24.0-macos-m1.dmg) (84 MB) -| [Linux](https://github.com/hearmeneigh/fchat-rising/releases/download/v1.24.0/F-Chat-Rising-1.24.0-linux.AppImage) (82 MB) - +[Windows x64](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-win-x64.exe) | +[Windows arm64](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-win-arm64.exe) | +[MacOS M1](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-macos-m1.dmg) | +[MacOS Intel](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-macos-intel.dmg) | +[Linux x64](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-linux-x64.AppImage) | +[Linux arm64](https://github.com/hearmeneigh/fchat-rising/releases/latest/download/F-Chat-Rising-linux-arm64.AppImage) # F-Chat Rising This repository contains a heavily customized version of the mainline F-Chat 3.0 client. diff --git a/electron/pack.js b/electron/pack.js index bb6b963..d3e146a 100644 --- a/electron/pack.js +++ b/electron/pack.js @@ -64,26 +64,49 @@ require('electron-packager')({ if(process.platform === 'win32') { console.log('Creating Windows installer'); const icon = path.join(__dirname, 'build', 'icon.ico'); - const setupName = `F-Chat Rising Setup.exe`; - if(fs.existsSync(path.join(distDir, setupName))) fs.unlinkSync(path.join(distDir, setupName)); - const nupkgName = path.join(distDir, `fchat-${pkg.version}-full.nupkg`); - const deltaName = path.join(distDir, `fchat-${pkg.version}-delta.nupkg`); - if(fs.existsSync(nupkgName)) fs.unlinkSync(nupkgName); - if(fs.existsSync(deltaName)) fs.unlinkSync(deltaName); - if(process.argv.length <= 3) console.warn('Warning: Creating unsigned installer'); - require('electron-winstaller').createWindowsInstaller({ - appDirectory: appPaths[0], - outputDirectory: distDir, - iconUrl: 'file:///%localappdata%\\fchat\\app.ico', - setupIcon: icon, - noMsi: true, - exe: 'F-Chat.exe', - title: 'F-Chat Rising', - setupExe: setupName, - name: 'fchat' - // remoteReleases: 'https://client.f-list.net/win32/' + (isBeta ? '?channel=beta' : ''), - // signWithParams: process.argv.length > 3 ? `/a /f ${process.argv[2]} /p ${process.argv[3]} /fd sha256 /tr http://timestamp.digicert.com /td sha256` : undefined - }).catch((e) => console.error(`Error while creating installer: ${e.message}`)); + + for (const appPath of appPaths) { + console.log('WinAppPath', appPath); + const appArch = appPath.match(/F-Chat-windows-([a-zA-Z0-9]+)$/)[1]; + const appArchLong = appArch === 'x64' ? 'x86_64' : 'aarch64'; + const setupName = `F-Chat-Rising-Setup-win-${appArch}.exe`; + const distFinal = path.join(distDir, appArch); + + console.log('DistFinal', distFinal); + + fs.mkdirSync(distFinal, {recursive: true}); + + if(fs.existsSync(path.join(distFinal, setupName))) { + fs.unlinkSync(path.join(distFinal, setupName)); + } + + const nupkgName = path.join(distFinal, `fchat-${pkg.version}-full.nupkg`); + const deltaName = path.join(distFinal, `fchat-${pkg.version}-delta.nupkg`); + + if(fs.existsSync(nupkgName)) fs.unlinkSync(nupkgName); + if(fs.existsSync(deltaName)) fs.unlinkSync(deltaName); + + if(process.argv.length <= 3) console.warn('Warning: Creating unsigned installer'); + + try { + await require('electron-winstaller').createWindowsInstaller({ + appDirectory: appPath, + outputDirectory: distFinal, + iconUrl: 'file:///%localappdata%\\fchat\\app.ico', + setupIcon: icon, + noMsi: true, + exe: 'F-Chat.exe', + title: 'F-Chat Rising', + setupExe: setupName, + name: 'fchat' + // remoteReleases: 'https://client.f-list.net/win32/' + (isBeta ? '?channel=beta' : ''), + // signWithParams: process.argv.length > 3 ? `/a /f ${process.argv[2]} /p ${process.argv[3]} /fd sha256 /tr http://timestamp.digicert.com /td sha256` : undefined + }); + } catch (e) { + console.error(`Error while creating installer: ${e.message}`); + throw e; + } + } } else if(process.platform === 'darwin') { console.log('Creating Mac DMG'); diff --git a/electron/release-scripts/windows-canary.sh b/electron/release-scripts/windows-canary.sh new file mode 100644 index 0000000..da94532 --- /dev/null +++ b/electron/release-scripts/windows-canary.sh @@ -0,0 +1,13 @@ +#!/bin/bash -ex + +DIST_PATH="${HOME}/fchat-rising/electron/dist" + +cd "${HOME}/fchat-rising" +git checkout canary +git pull +yarn + +rm -rf "${DIST_PATH}" + +cd electron +yarn build:dist diff --git a/electron/release-scripts/windows.sh b/electron/release-scripts/windows.sh new file mode 100644 index 0000000..b5448ca --- /dev/null +++ b/electron/release-scripts/windows.sh @@ -0,0 +1,24 @@ +#!/bin/bash -ex + +if [ -z "${1}" ] +then + echo "Usage: ${0} RELEASE_VERSION" + exit 1 +fi + +RELEASE_VERSION="${1}" +RELEASE_PATH="${HOME}/fchat-rising-dist/${RELEASE_VERSION}" +DIST_PATH="${HOME}/fchat-rising/electron/dist" + +cd "${HOME}/fchat-rising" +git checkout master +git pull +yarn + +mkdir -p "${RELEASE_PATH}" +rm -rf "${DIST_PATH}" + +cd electron +yarn build:dist +node pack.js +