Skip to content

Commit

Permalink
autorelease refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
evolutionleo committed Apr 5, 2024
1 parent 9e6518a commit e1a79e0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
Binary file modified Release/GMClient.zip
Binary file not shown.
Binary file modified Release/JSServer.zip
Binary file not shown.
Binary file modified Release/TSServer.zip
Binary file not shown.
45 changes: 20 additions & 25 deletions autorelease/release.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const AdmZip = require('adm-zip');
const path = require('path');
const fs = require('fs');

let curr_zip;
let curr_folder;
let curr_path;

let addFolder = (name) => {
curr_zip.addLocalFolder(path.join(__dirname, '..', `${curr_folder}`, `${name}/`), `/${name}`);
Expand All @@ -11,44 +13,37 @@ let addFile = (name) => {
curr_zip.addLocalFile(path.join(__dirname, '..', `${curr_folder}`, name), '');
}

const zip_ignore = ['node_modules', 'package-lock.json', 'out'];

let addAll = (curr_path) => {
fs.readdirSync(curr_path).forEach((file) => {
if (zip_ignore.includes(file)) return;

if (file.includes('.'))
addFile(file);
else
addFolder(file);
});
}

// TypeScript server
const ts_zip = new AdmZip();
curr_zip = ts_zip;
curr_folder = 'TypescriptServer';
addFolder('src');
curr_path = path.join(__dirname, '..', `${curr_folder}`);

addFile('package.json');
addFile('tsconfig.json');
addFile('jsconfig.json');
addFile('.gitignore');
addFile('README.md');
addAll(curr_path);

ts_zip.writeZip('../Release/TSServer.zip');


// JavaScript server
const js_zip = new AdmZip();
curr_zip = js_zip;
curr_folder = 'JavascriptServer'

addFolder('cmd');
addFolder('maps');
addFolder('util');
addFolder('schemas');
addFolder('concepts');
addFolder('entities');
addFolder('initializers');


addFile('package.json');
addFile('jsconfig.json');

addFile('.gitignore');
addFile('README.md');
curr_folder = 'JavascriptServer';
curr_path = path.join(__dirname, '..', `${curr_folder}`);

addFile('server.js');
addFile('config.js');
addFile('packet.js');
addAll(curr_path);

js_zip.writeZip('../Release/JSServer.zip');

Expand Down

0 comments on commit e1a79e0

Please sign in to comment.