summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-05-20 15:02:05 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-05-20 15:02:05 +0200
commit992319ca19b68db963ebb8740034434c5b5dbc0d (patch)
treec8e523c93a2d1daae9235ab8375a7ff8576baa50
parent29780698e69011f234d6e5ecee065c8d0ebe3d4a (diff)
downloadchatroom-mane.tar.gz
chatroom-mane.tar.bz2
chatroom-mane.zip
Updated 3 filesHEADmane
-rw-r--r--.idea/chatroom.iml1
-rwxr-xr-xbuild.js22
-rwxr-xr-xclient/main.js5
3 files changed, 25 insertions, 3 deletions
diff --git a/.idea/chatroom.iml b/.idea/chatroom.iml
index ff88395..a02ba86 100644
--- a/.idea/chatroom.iml
+++ b/.idea/chatroom.iml
@@ -5,6 +5,7 @@
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
diff --git a/build.js b/build.js
index c10b079..6dfc857 100755
--- a/build.js
+++ b/build.js
@@ -4,6 +4,12 @@ const zlib = require('zlib');
const child_process = require("child_process");
const crypto = require("crypto");
+if (process.argv[2] === "version") {
+ process['versionMode'] = true;
+ require('./client/main');
+ return;
+}
+
console.log("Note: use './build.js launcher' to build the launchers.");
let ignore = [
@@ -70,9 +76,19 @@ for (let item of list) {
fs.writeFileSync("build/client.lctpk", zlib.brotliCompressSync(JSON.stringify(pack)));
child_process.execSync("scp build/client.lctpk watson:/opt/localchat/update/client.lctpk", { stdio: "inherit" });
+child_process.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file ./build/client.lctpk https://source.equestria.dev/api/v4/projects/74/packages/generic/chatroom-client/"$(node build.js version)"-${Math.round(new Date().getTime() / 1000).toString(16)}/chatroom-client.lctpk`, { stdio: "inherit" });
if (process.argv[2] === "launcher") {
- child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.icns --platform=darwin --arch=arm64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" })
- child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.ico --platform=win32 --arch=x64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" })
- child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.png --platform=linux --arch=x64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" })
+ let id = Math.round(new Date().getTime() / 1000).toString(16);
+
+ child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.icns --platform=darwin --arch=arm64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" });
+ child_process.execSync(`zip -r ../../../build/client/Chatroom-Mac-ARM64.zip -- Chatroom.app`, { stdio: "inherit", cwd: "./build/client/Chatroom-darwin-arm64" });
+ child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.ico --platform=win32 --arch=x64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" });
+ child_process.execSync(`zip -r ../../../build/client/Chatroom-Win32-x64.zip -- *`, { stdio: "inherit", cwd: "./build/client/Chatroom-win32-x64" });
+ child_process.execSync("npx electron-packager . Chatroom --ignore build --ignore scripts --overwrite --icon icon.png --platform=linux --arch=x64 --out=../../build/client", { cwd: "./launcher/client", stdio: "inherit" });
+ child_process.execSync(`zip -r ../../../build/client/Chatroom-Linux-x64.zip -- *`, { stdio: "inherit", cwd: "./build/client/Chatroom-linux-x64" });
+ child_process.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file ./build/client/Chatroom-Mac-ARM64.zip https://source.equestria.dev/api/v4/projects/74/packages/generic/chatroom-loader/${id}/Chatroom-Mac-ARM64.zip`, { stdio: "inherit" });
+ child_process.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file ./build/client/Chatroom-Win32-x64.zip https://source.equestria.dev/api/v4/projects/74/packages/generic/chatroom-loader/${id}/Chatroom-Win32-x64.zip`, { stdio: "inherit" });
+ child_process.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file ./build/client/Chatroom-Linux-x64.zip https://source.equestria.dev/api/v4/projects/74/packages/generic/chatroom-loader/${id}/Chatroom-Linux-x64.zip`, { stdio: "inherit" });
+ child_process.execSync('rm -rf ./build/client/*.zip');
}
diff --git a/client/main.js b/client/main.js
index 41550aa..0d61efb 100755
--- a/client/main.js
+++ b/client/main.js
@@ -4,6 +4,11 @@ const buildNumber = "main";
let version = "2.9.7";
+if (process['versionMode']) {
+ console.log(version);
+ return;
+}
+
const { desktopCapturer, protocol, app, BrowserWindow, webContents, globalShortcut, nativeTheme, ipcMain, session, dialog, Menu } = require('electron');
const os = require("os");
const {writeFileSync} = require("fs");