Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added workflow for creating releases #14

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push

name: Create Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 16.17.0

- name: Install Packages & Run Script
run: npm i && npm run build

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ github.workspace }}/changelog.md
files: dist/*.mc*
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ node_modules

build.js

scripts/*
!scripts/index.js
!scripts/index.js.map
project/behavior/scripts
dist
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"request": "attach",
"name": "Wait for Minecraft Debug Connections",
"mode": "listen",
"localRoot": "${workspaceFolder}/",
"localRoot": "${workspaceFolder}/project",
"port": 19144
}
]
Expand Down
88 changes: 60 additions & 28 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,65 @@
const archiver = require("archiver");
const fs = require("fs-extra");
const esbuild = require("esbuild");
const fsExtra = require("fs-extra");
const path = require("path");
const isDev = process.argv[2] === "dev";

const dir = "./scripts";
const ver = JSON.parse(
fs.readFileSync(path.join(__dirname, "package.json"))
)?.version;
const name = JSON.parse(
fs.readFileSync(path.join(__dirname, "package.json"))
)?.name;

if (!fsExtra.existsSync(dir)) {
fsExtra.mkdirSync(dir);
esbuild
.build({
entryPoints: ["project/behavior/src/index.ts"],
bundle: true,
outfile: "project/behavior/scripts/index.js",
minify: !isDev,
platform: "neutral",
watch: isDev,
external: [
"@minecraft/server",
"@minecraft/server-ui",
"@minecraft/server-net",
"@minecraft/server-admin",
],
legalComments: isDev ? "none" : "none",
})
.then(() => {
console.log(
`\x1b[33m%s\x1b[0m`,
`[${new Date().toLocaleTimeString()}]`,
`Built for ${isDev ? "development" : "production"}...`
);

if (!isDev) {
const distDir = path.join(__dirname, "dist");
buildPack("behavior",path.join(__dirname,"project","behavior"),distDir);
buildPack("resource",path.join(__dirname,"project","resource"),distDir);
buildPack("fullpack",distDir,distDir,".mcaddon");
} else {
console.log(
`\x1b[31m%s\x1b[0m`,
`[${new Date().toLocaleTimeString()}]`,"This feature is currently being worked on :P");
process.exit(0);
}
});

function buildPack(fileName,target,destination,ext=".mcpack") {
if (!fs.existsSync(destination)) {
fs.mkdirSync(destination);
}

const output = fs.createWriteStream(path.join(destination,fileName + "-" + name + "." + ver + ext));
const archive = archiver("zip", {
zlib: { level: 9 }, // Sets the compression level.
});

archive.pipe(output);

archive.directory(target, false)

archive.finalize();
}
fsExtra.emptyDirSync(dir);

esbuild.build({
entryPoints: ["src/index.ts"],
bundle: true,
outfile: "scripts/index.js",
minify: !isDev,
platform: "neutral",
sourcemap: true,
watch: isDev,
external: [
"@minecraft/server",
"@minecraft/server-ui",
"@minecraft/server-net",
"@minecraft/server-admin",
],
legalComments: isDev ? "none" : "none",
}).then((r) => {
console.log(
`\x1b[33m%s\x1b[0m`,
`[${new Date().toLocaleTimeString()}]`,
`Built for ${isDev ? "development" : "production"}...`
);
})
17 changes: 17 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**Rubedo 2.6.4**

FIXED HUGE MEMORY LEAK... Caused by the new Database system, and a lot of async await.

Changelog:

- Converted `betweenXYZ` to `betweenVector3` ( thanks to <@249508447471665152> for showing this looks like `betweenXYZ` is ~80% slower lmao )

- Converted almost 200+ functions back to normal `get`
- Added alternate options for database `get` `getSync` etc.
- Added logging for gamemode protection
- Added actual event orders and made protections not load until database loads
- Updated Forms to show faster and to reduce lag when loading
- Improved Script performance across the whole pack.
- `has_container_open` now uses `component_groups` to improve script performace
- Improved performance for Chest GUI
- Updated `-ping` command to show actuate information for Ticks Per Second.
Loading