mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 07:46:20 +00:00
[MIRROR] Juke Build 0.8.1 + Juke Build 0.8.1 Hotfix 1 + Skyrat Juke Build Hotfix (#7645)
* Juke Build 0.8.1 (#60404) * Juke Build 0.8.1 Hotfix 1 (#60897) * Juke Build 0.8.1 Hotfix 1 * Do not restore Yarn cache on just DM build * Makes it so Skyrat's modular code is also checked for updates to see if it needs to rebuild * chmod's tools/bootstrap/nod Added a / just to make it so it'd let me commit * Trying to chmod again Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
44
.github/workflows/ci_suite.yml
vendored
44
.github/workflows/ci_suite.yml
vendored
@@ -13,11 +13,16 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup cache
|
||||
- name: Restore SpacemanDMM cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: $HOME/SpacemanDMM
|
||||
key: ${{ runner.os }}-spacemandmm
|
||||
path: ~/SpacemanDMM
|
||||
key: ${{ runner.os }}-spacemandmm-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Restore Yarn cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: tgui/.yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Install Tools
|
||||
run: |
|
||||
pip3 install setuptools
|
||||
@@ -28,11 +33,9 @@ jobs:
|
||||
run: |
|
||||
bash tools/ci/check_filedirs.sh tgstation.dme
|
||||
bash tools/ci/check_changelogs.sh
|
||||
find . -name "*.php" -print0 | xargs -0 -n1 php -l
|
||||
find . -name "*.json" -not -path "*/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py
|
||||
tgui/bin/tgui --lint
|
||||
tgui/bin/tgui --test
|
||||
bash tools/ci/check_grep.sh
|
||||
bash tools/ci/check_misc.sh
|
||||
tools/build/build --ci lint
|
||||
tools/bootstrap/python -m dmi.test
|
||||
tools/bootstrap/python -m mapmerge2.dmm_test
|
||||
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
|
||||
@@ -48,17 +51,16 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup cache
|
||||
- name: Restore BYOND cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: $HOME/BYOND
|
||||
key: ${{ runner.os }}-byond
|
||||
path: ~/BYOND
|
||||
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Compile All Maps
|
||||
run: |
|
||||
bash tools/ci/install_byond.sh
|
||||
source $HOME/BYOND/byond/bin/byondsetup
|
||||
python3 tools/ci/template_dm_generator.py
|
||||
tools/build/build dm -DCIBUILDING -DCITESTING -DALL_MAPS
|
||||
tools/build/build --ci dm -DCIBUILDING -DCITESTING -DALL_MAPS
|
||||
|
||||
run_all_tests:
|
||||
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
||||
@@ -74,11 +76,16 @@ jobs:
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup cache
|
||||
- name: Restore BYOND cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: $HOME/BYOND
|
||||
key: ${{ runner.os }}-byond
|
||||
path: ~/BYOND
|
||||
key: ${{ runner.os }}-byond-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Restore Yarn Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: tgui/.yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Setup database
|
||||
run: |
|
||||
sudo systemctl start mysql
|
||||
@@ -96,7 +103,7 @@ jobs:
|
||||
run: |
|
||||
bash tools/ci/install_byond.sh
|
||||
source $HOME/BYOND/byond/bin/byondsetup
|
||||
tools/build/build -DCIBUILDING
|
||||
tools/build/build --ci -DCIBUILDING
|
||||
bash tools/ci/run_server.sh
|
||||
|
||||
test_windows:
|
||||
@@ -105,6 +112,11 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Restore Yarn Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: tgui/.yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ secrets.CACHE_PURGE_KEY }}
|
||||
- name: Compile
|
||||
run: pwsh tools/ci/build.ps1
|
||||
env:
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,8 +12,11 @@
|
||||
|
||||
#Ignore compiled files and other files generated during compilation.
|
||||
*.mdme
|
||||
*.mdme.*
|
||||
*.dmb
|
||||
*.rsc
|
||||
*.m.dme
|
||||
*.test.dme
|
||||
*.lk
|
||||
*.int
|
||||
*.backup
|
||||
|
||||
3
CLEAN.bat
Normal file
3
CLEAN.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call "%~dp0\tools\build\build.bat" dist-clean
|
||||
pause
|
||||
3
RUN_SERVER.bat
Normal file
3
RUN_SERVER.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call "%~dp0\tools\build\build.bat" server %*
|
||||
pause
|
||||
@@ -12,7 +12,7 @@ export RUST_G_VERSION=0.4.10
|
||||
|
||||
#node version
|
||||
export NODE_VERSION=12
|
||||
export NODE_VERSION_PRECISE=12.20.0
|
||||
export NODE_VERSION_PRECISE=12.22.4
|
||||
|
||||
# SpacemanDMM git tag
|
||||
export SPACEMAN_DMM_VERSION=suite-1.7
|
||||
|
||||
3
tools/build/build.js
Executable file → Normal file
3
tools/build/build.js
Executable file → Normal file
@@ -61,6 +61,7 @@ export const DmTarget = new Juke.Target({
|
||||
'html/**',
|
||||
'icons/**',
|
||||
'interface/**',
|
||||
'modular_skyrat/**', ///SKYRAT EDIT ADDITION - Making the CBT work
|
||||
`${DME_NAME}.dme`,
|
||||
],
|
||||
outputs: [
|
||||
@@ -192,7 +193,7 @@ export const TguiLintTarget = new Juke.Target({
|
||||
export const TguiDevTarget = new Juke.Target({
|
||||
dependsOn: [YarnTarget],
|
||||
executes: async ({ args }) => {
|
||||
await yarn('node', 'packages/tgui-dev-server/index.js', ...args);
|
||||
await yarn('node', 'packages/tgui-dev-server/index.esm.js', ...args);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
const Juke = require('../juke');
|
||||
const { stat } = require('./fs');
|
||||
const { regQuery } = require('./winreg');
|
||||
const fs = require('fs');
|
||||
|
||||
/**
|
||||
* Cached path to DM compiler
|
||||
*/
|
||||
let dmPath;
|
||||
|
||||
/**
|
||||
* DM compiler
|
||||
*
|
||||
* @param {string} dmeFile
|
||||
* @param {{ defines?: string[] }} options
|
||||
*/
|
||||
const dm = async (dmeFile, options = {}) => {
|
||||
// Get path to DM compiler
|
||||
if (!dmPath) {
|
||||
dmPath = await (async () => {
|
||||
// Search in array of paths
|
||||
const paths = [
|
||||
...((process.env.DM_EXE && process.env.DM_EXE.split(',')) || []),
|
||||
'C:\\Program Files\\BYOND\\bin\\dm.exe',
|
||||
'C:\\Program Files (x86)\\BYOND\\bin\\dm.exe',
|
||||
['reg', 'HKLM\\Software\\Dantom\\BYOND', 'installpath'],
|
||||
['reg', 'HKLM\\SOFTWARE\\WOW6432Node\\Dantom\\BYOND', 'installpath'],
|
||||
];
|
||||
const isFile = path => {
|
||||
try {
|
||||
const fstat = stat(path);
|
||||
return fstat && fstat.isFile();
|
||||
}
|
||||
catch (err) {}
|
||||
return false;
|
||||
};
|
||||
for (let path of paths) {
|
||||
// Resolve a registry key
|
||||
if (Array.isArray(path)) {
|
||||
const [type, ...args] = path;
|
||||
path = await regQuery(...args);
|
||||
}
|
||||
if (!path) {
|
||||
continue;
|
||||
}
|
||||
// Check if path exists
|
||||
if (isFile(path)) {
|
||||
return path;
|
||||
}
|
||||
if (isFile(path + '/dm.exe')) {
|
||||
return path + '/dm.exe';
|
||||
}
|
||||
if (isFile(path + '/bin/dm.exe')) {
|
||||
return path + '/bin/dm.exe';
|
||||
}
|
||||
}
|
||||
// Default paths
|
||||
return (
|
||||
process.platform === 'win32' && 'dm.exe'
|
||||
|| 'DreamMaker'
|
||||
);
|
||||
})();
|
||||
}
|
||||
// Get project basename
|
||||
const dmeBaseName = dmeFile.replace(/\.dme$/, '');
|
||||
// Make sure output files are writable
|
||||
const testOutputFile = (name) => {
|
||||
try {
|
||||
fs.closeSync(fs.openSync(name, 'r+'));
|
||||
}
|
||||
catch (err) {
|
||||
if (err && err.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
if (err && err.code === 'EBUSY') {
|
||||
Juke.logger.error(`File '${name}' is locked by the DreamDaemon process.`);
|
||||
Juke.logger.error(`Stop the currently running server and try again.`);
|
||||
throw new Juke.ExitCode(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
testOutputFile(`${dmeBaseName}.dmb`);
|
||||
testOutputFile(`${dmeBaseName}.rsc`);
|
||||
// Compile
|
||||
const { defines } = options;
|
||||
if (defines && defines.length > 0) {
|
||||
const injectedContent = defines
|
||||
.map(x => `#define ${x}\n`)
|
||||
.join('');
|
||||
fs.writeFileSync(`${dmeBaseName}.mdme`, injectedContent);
|
||||
const dmeContent = fs.readFileSync(`${dmeBaseName}.dme`);
|
||||
fs.appendFileSync(`${dmeBaseName}.mdme`, dmeContent);
|
||||
await Juke.exec(dmPath, [`${dmeBaseName}.mdme`]);
|
||||
fs.writeFileSync(`${dmeBaseName}.dmb`, fs.readFileSync(`${dmeBaseName}.mdme.dmb`));
|
||||
fs.writeFileSync(`${dmeBaseName}.rsc`, fs.readFileSync(`${dmeBaseName}.mdme.rsc`));
|
||||
fs.unlinkSync(`${dmeBaseName}.mdme.dmb`);
|
||||
fs.unlinkSync(`${dmeBaseName}.mdme.rsc`);
|
||||
fs.unlinkSync(`${dmeBaseName}.mdme`);
|
||||
}
|
||||
else {
|
||||
await Juke.exec(dmPath, [dmeFile]);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
dm,
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* @copyright 2020 Aleksej Komarov
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
/**
|
||||
* Returns file stats for the provided path, or null if file is
|
||||
* not accessible.
|
||||
*/
|
||||
const stat = path => {
|
||||
try {
|
||||
return fs.statSync(path);
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
stat,
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* Tools for dealing with Windows Registry bullshit.
|
||||
*
|
||||
* Adapted from `tgui/packages/tgui-dev-server/winreg.js`.
|
||||
*
|
||||
* @file
|
||||
* @copyright 2020 Aleksej Komarov
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
const { exec } = require('child_process');
|
||||
const { promisify } = require('util');
|
||||
|
||||
const regQuery = async (path, key) => {
|
||||
if (process.platform !== 'win32') {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const command = `reg query "${path}" /v ${key}`;
|
||||
const { stdout } = await promisify(exec)(command);
|
||||
const keyPattern = ` ${key} `;
|
||||
const indexOfKey = stdout.indexOf(keyPattern);
|
||||
if (indexOfKey === -1) {
|
||||
return null;
|
||||
}
|
||||
const indexOfEol = stdout.indexOf('\r\n', indexOfKey);
|
||||
if (indexOfEol === -1) {
|
||||
return null;
|
||||
}
|
||||
const indexOfValue = stdout.indexOf(
|
||||
' ',
|
||||
indexOfKey + keyPattern.length);
|
||||
if (indexOfValue === -1) {
|
||||
return null;
|
||||
}
|
||||
const value = stdout.substring(indexOfValue + 4, indexOfEol);
|
||||
return value;
|
||||
}
|
||||
catch (err) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
regQuery,
|
||||
};
|
||||
@@ -1,17 +0,0 @@
|
||||
const { exec, resolveGlob } = require('../juke');
|
||||
|
||||
let yarnPath;
|
||||
|
||||
const yarn = (...args) => {
|
||||
if (!yarnPath) {
|
||||
yarnPath = resolveGlob('./tgui/.yarn/releases/yarn-*.cjs')[0]
|
||||
.replace('/tgui/', '/');
|
||||
}
|
||||
return exec('node', [yarnPath, ...args], {
|
||||
cwd: './tgui',
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
yarn,
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
folders = ["_maps/RandomRuins", "_maps/RandomZLevels", "_maps/shuttles",
|
||||
"_maps/templates"]
|
||||
|
||||
generated = "_maps/templates.dm"
|
||||
|
||||
template_filenames = []
|
||||
|
||||
def find_dm(path):
|
||||
L = []
|
||||
for dirpath, dirnames, filenames in os.walk(path):
|
||||
for name in filenames:
|
||||
if name.endswith(".dmm"):
|
||||
s = os.path.join(dirpath, name)
|
||||
s = s.replace("_maps/","")
|
||||
L.append(s)
|
||||
return L
|
||||
|
||||
for folder in folders:
|
||||
template_filenames.extend(find_dm(folder))
|
||||
|
||||
with open(generated, 'w') as f:
|
||||
for template in template_filenames:
|
||||
f.write('''#include "{}"\n'''.format(template))
|
||||
|
||||
Reference in New Issue
Block a user