diff options
-rw-r--r-- | .idea/chatroom.iml | 1 | ||||
-rwxr-xr-x | build.js | 22 | ||||
-rwxr-xr-x | client/main.js | 5 |
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" />
@@ -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"); |