chore: add publish functionality to justfile

This commit is contained in:
Jef Roosens 2025-05-13 10:06:49 +02:00
parent e8a92d7e07
commit 638e228ba4
Signed by: Jef Roosens
GPG key ID: 02D4C0997E74717B
3 changed files with 52 additions and 11 deletions

View file

@ -1,7 +1,16 @@
[group('build')]
build:
cargo build --frozen --workspace
alias b := build
[group('build')]
build-release target:
cargo build \
--release \
--frozen \
--workspace \
--target '{{ target }}'
test:
cargo test --frozen --workspace
alias t := test
@ -23,3 +32,29 @@ clean:
doc:
cargo doc --workspace --frozen
run:
mkdir -p data
cargo run --frozen --package alex -- run \
--config data/config \
--backup data/backups \
--world data/worlds \
--jar ./paper-1.21.5-77.jar \
--java '/usr/lib/jvm/java-21-openjdk/bin/java' \
--layers '2min,2,4,4;3min,3,2,2'
publish-release-binaries tag: (build-release 'x86_64-unknown-linux-musl') (build-release 'aarch64-unknown-linux-musl')
# Check the binaries are proper static binaries
[ "$(readelf -d target/x86_64-unknown-linux-musl/release/alex | grep NEEDED | wc -l)" = 0 ]
[ "$(readelf -d target/aarch64-unknown-linux-musl/release/alex | grep NEEDED | wc -l)" = 0 ]
curl \
--netrc \
--fail \
--upload-file target/x86_64-unknown-linux-musl/release/alex \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/alex/"{{ tag }}"/alex-linux-amd64
curl \
--netrc \
--fail \
--upload-file target/aarch64-unknown-linux-musl/release/alex \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/alex/"{{ tag }}"/alex-linux-arm64