Skip to content

Commit

Permalink
Update release process
Browse files Browse the repository at this point in the history
Includes scripts for publishing to wally and npm
  • Loading branch information
YetAnotherClown committed Jul 10, 2024
1 parent 41e079a commit 0a526ef
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 12 deletions.
20 changes: 20 additions & 0 deletions dev.darklua.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"process": [
{
"rule": "convert_require",
"current": {
"name": "path",
"sources": {
"@yetanothernet": "lib/",
"@serdes": "lib/serdes",
"@dev-packages": "DevPackages/"
}
},
"target": {
"name": "roblox",
"rojo_sourcemap": "sourcemap.json",
"indexing_style": "wait_for_child"
}
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"license": "MIT",
"typings": "lib/index.d.ts",
"files": [
"lib/"
"lib/!(__*__)"
],
"publishConfig": {
"access": "public"
Expand Down
1 change: 1 addition & 0 deletions .darklua.json → publish.darklua.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"location": "start",
"text": "Copyright (c) YetAnotherClown, MIT License\nThe source code can be found at: https://github.com/YetAnotherClown/YetAnotherNet"
},
"remove_debug_profiling",
"compute_expression",
"remove_unused_if_branch",
"remove_unused_while",
Expand Down
6 changes: 1 addition & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

set -e

if [ ! -d "DevPackages" ]; then
sh scripts/install-dependencies.sh
fi

rojo sourcemap default.project.json -o sourcemap.json

darklua process --config .darklua.json lib/ dist/
darklua process --config publish.darklua.json lib/ dist/lib
rojo build build.project.json -o YetAnotherNet.rbxm
4 changes: 2 additions & 2 deletions scripts/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fi

rojo serve dev.project.json \
& rojo sourcemap default.project.json -o sourcemap.json --watch \
& darklua process --config .darklua.json --watch lib/ dist/lib \
& darklua process --config .darklua.json --watch tests/ dist/tests
& darklua process --config dev.darklua.json --watch lib/ dist/lib \
& darklua process --config dev.darklua.json --watch tests/ dist/tests
19 changes: 19 additions & 0 deletions scripts/publish-rbxts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e

rojo sourcemap default.project.json -o sourcemap.json
darklua process --config publish.darklua.json lib/ dist/lib

cd ./dist

cp ../package.json package.json
cp ../README.md README.md
cp ../LICENSE LICENSE
cp ../lib/index.d.ts ./lib/index.d.ts

if [ "$1" = "--publish" ]; then
npm publish
else
npm pack
fi
20 changes: 20 additions & 0 deletions scripts/publish-wally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

set -e

rojo sourcemap default.project.json -o sourcemap.json
darklua process --config publish.darklua.json lib/ dist/lib

cp README.md dist/README.md
cp LICENSE dist/LICENSE
cp build.project.json dist/default.project.json
cp wally.toml dist/wally.toml
cp wally.lock dist/wally.lock

cd ./dist

if [ "$1" = "--publish" ]; then
wally publish
else
wally package --output release.zip
fi
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ ! -d ./DevPackages ]; then
./scripts/install-wally.sh
fi

darklua process --config .darklua.json --watch lib/ dist/lib \
& darklua process --config .darklua.json --watch tests/ dist/tests \
darklua process --config dev.darklua.json --watch lib/ dist/lib \
& darklua process --config dev.darklua.json --watch tests/ dist/tests \
& rojo build dev.project.json --output $OUTPUT \
& run-in-roblox --place $OUTPUT --script ./dist/tests/startJest.server.luau --port $PORT
6 changes: 4 additions & 2 deletions wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ license = "MIT"
authors = ["YetAnotherClown"]
realm = "shared"
registry = "https://github.com/UpliftGames/wally-index"
exclude = ["**"]
include = ["lib", "lib/*", "default.project.json", "wally.toml", "wally.lock"]

# publish-wally.sh will clone to /dist and run wally publish in that directory
exclude = ["tests", "tests/*", "lib/__*__", "lib/__*__/*", "package.json", "*.tgz", "*.zip"]
include = ["wally.lock"]

[dev-dependencies]
Jest = "jsdotlua/[email protected]"
Expand Down

0 comments on commit 0a526ef

Please sign in to comment.