Compare commits
15 Commits
v0.5.0
...
creations-
| Author | SHA1 | Date | |
|---|---|---|---|
|
7ba16464c4
|
|||
|
66230d031c
|
|||
|
f6aa44ffc5
|
|||
|
ae166d8509
|
|||
|
a4ae552169
|
|||
|
23d687e072
|
|||
|
71bbfa0128
|
|||
|
89da9108c2
|
|||
|
04d5592aaf
|
|||
|
bd3605ab87
|
|||
|
13cff42bbc
|
|||
|
60ba5511ad
|
|||
|
cf67ad510b
|
|||
|
e6a548a1a1
|
|||
|
d2bee93fbb
|
22
.drone.yml
22
.drone.yml
@@ -7,17 +7,6 @@ platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: clux/muslrust:1.89.0-stable
|
||||
commands:
|
||||
- cargo build --release --target x86_64-unknown-linux-musl
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
- name: image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
@@ -30,15 +19,6 @@ steps:
|
||||
password:
|
||||
from_secret: GIT_PASS
|
||||
dockerfile: Containerfile
|
||||
depends_on:
|
||||
- build
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
---
|
||||
kind: signature
|
||||
hmac: 52507904dfaada892c05a61422dc5e147c1438419ed841d0f1e3e3ec2b193540
|
||||
|
||||
...
|
||||
- master
|
||||
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -124,7 +124,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
|
||||
|
||||
[[package]]
|
||||
name = "asset-tool"
|
||||
version = "0.5.0"
|
||||
version = "0.4.12"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -1449,7 +1449,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rbx_asset"
|
||||
version = "0.5.0"
|
||||
version = "0.4.10"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"chrono",
|
||||
|
||||
10
Cargo.toml
10
Cargo.toml
@@ -1,7 +1,7 @@
|
||||
workspace = { members = ["rbx_asset", "rox_compiler"] }
|
||||
[package]
|
||||
name = "asset-tool"
|
||||
version = "0.5.0"
|
||||
version = "0.4.12"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
@@ -10,9 +10,9 @@ edition = "2021"
|
||||
anyhow = "1.0.75"
|
||||
clap = { version = "4.4.2", features = ["derive"] }
|
||||
futures = "0.3.30"
|
||||
git2 = { version = "0.20.0", optional = true }
|
||||
git2 = "0.20.0"
|
||||
lazy-regex = "3.1.0"
|
||||
rbx_asset = { path = "rbx_asset", features = ["gzip", "rustls-tls"], default-features = false }
|
||||
rbx_asset = { path = "rbx_asset" }
|
||||
rbx_binary = "1.0.0"
|
||||
rbx_dom_weak = "3.0.0"
|
||||
rbx_reflection_database = "1.0.3"
|
||||
@@ -21,10 +21,6 @@ rox_compiler = { path = "rox_compiler" }
|
||||
serde_json = "1.0.111"
|
||||
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread", "fs"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
git = ["dep:git2"]
|
||||
|
||||
[profile.release]
|
||||
#lto = true
|
||||
strip = true
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
FROM alpine:3.22 AS runtime
|
||||
COPY /target/x86_64-unknown-linux-musl/release/asset-tool /
|
||||
ENTRYPOINT ["/asset-tool"]
|
||||
# Using the `rust-musl-builder` as base image, instead of
|
||||
# the official Rust toolchain
|
||||
FROM docker.io/clux/muslrust:stable AS chef
|
||||
USER root
|
||||
RUN cargo install cargo-chef
|
||||
WORKDIR /app
|
||||
|
||||
FROM chef AS planner
|
||||
COPY . .
|
||||
RUN cargo chef prepare --recipe-path recipe.json
|
||||
|
||||
FROM chef AS builder
|
||||
COPY --from=planner /app/recipe.json recipe.json
|
||||
# Notice that we are specifying the --target flag!
|
||||
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
|
||||
COPY . .
|
||||
RUN cargo build --release --target x86_64-unknown-linux-musl --bin asset-tool
|
||||
|
||||
FROM docker.io/alpine:latest AS runtime
|
||||
RUN addgroup -S myuser && adduser -S myuser -G myuser
|
||||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/asset-tool /usr/local/bin/
|
||||
USER myuser
|
||||
ENTRYPOINT ["/usr/local/bin/asset-tool"]
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rbx_asset"
|
||||
version = "0.5.0"
|
||||
version = "0.4.10"
|
||||
edition = "2021"
|
||||
publish = ["strafesnet"]
|
||||
repository = "https://git.itzana.me/StrafesNET/asset-tool"
|
||||
|
||||
11
src/main.rs
11
src/main.rs
@@ -8,7 +8,6 @@ use rbx_asset::cookie::{Cookie,Context as CookieContext,AssetVersion,CreationsIt
|
||||
|
||||
type AssetID=u64;
|
||||
type AssetIDFileMap=Vec<(AssetID,PathBuf)>;
|
||||
#[cfg(feature="git")]
|
||||
const CONCURRENT_DECODE:usize=8;
|
||||
const CONCURRENT_REQUESTS:usize=32;
|
||||
const CONCURRENT_FS:usize=64;
|
||||
@@ -44,9 +43,7 @@ enum Commands{
|
||||
CompileUploadAsset(CompileUploadAssetSubcommand),
|
||||
CompileUploadPlace(CompileUploadPlaceSubcommand),
|
||||
Decompile(DecompileSubcommand),
|
||||
#[cfg(feature="git")]
|
||||
DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand),
|
||||
#[cfg(feature="git")]
|
||||
DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand),
|
||||
RunLuau(RunLuauSubcommand),
|
||||
}
|
||||
@@ -742,7 +739,6 @@ async fn main()->AResult<()>{
|
||||
write_models:subcommand.write_models.unwrap_or(false),
|
||||
write_scripts:subcommand.write_scripts.unwrap_or(true),
|
||||
}).await,
|
||||
#[cfg(feature="git")]
|
||||
Commands::DecompileHistoryIntoGit(subcommand)=>decompile_history_into_git(DecompileHistoryConfig{
|
||||
git_committer_name:subcommand.git_committer_name,
|
||||
git_committer_email:subcommand.git_committer_email,
|
||||
@@ -753,7 +749,6 @@ async fn main()->AResult<()>{
|
||||
write_models:subcommand.write_models.unwrap_or(false),
|
||||
write_scripts:subcommand.write_scripts.unwrap_or(true),
|
||||
}).await,
|
||||
#[cfg(feature="git")]
|
||||
Commands::DownloadAndDecompileHistoryIntoGit(subcommand)=>download_and_decompile_history_into_git(DownloadAndDecompileHistoryConfig{
|
||||
git_committer_name:subcommand.git_committer_name,
|
||||
git_committer_email:subcommand.git_committer_email,
|
||||
@@ -1717,7 +1712,6 @@ async fn download_decompile(config:DownloadDecompileConfig)->AResult<()>{
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
struct WriteCommitConfig{
|
||||
git_committer_name:String,
|
||||
git_committer_email:String,
|
||||
@@ -1728,7 +1722,6 @@ struct WriteCommitConfig{
|
||||
write_scripts:bool,
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,rox_compiler::DecompiledContext)>,tokio::task::JoinError>,repo:&git2::Repository)->AResult<()>{
|
||||
let (asset_version,context)=b??;
|
||||
println!("writing files for version {}",asset_version.assetVersionNumber);
|
||||
@@ -1810,7 +1803,6 @@ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,ro
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
struct DecompileHistoryConfig{
|
||||
git_committer_name:String,
|
||||
git_committer_email:String,
|
||||
@@ -1822,7 +1814,6 @@ struct DecompileHistoryConfig{
|
||||
write_scripts:bool,
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
|
||||
//use prexisting versions list
|
||||
let mut versions_path=config.input_folder.clone();
|
||||
@@ -1861,7 +1852,6 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
struct DownloadAndDecompileHistoryConfig{
|
||||
cookie:Cookie,
|
||||
asset_id:AssetID,
|
||||
@@ -1874,7 +1864,6 @@ struct DownloadAndDecompileHistoryConfig{
|
||||
write_scripts:bool,
|
||||
}
|
||||
|
||||
#[cfg(feature="git")]
|
||||
async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHistoryConfig)->AResult<()>{
|
||||
let context=CookieContext::new(config.cookie);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user