A command-line tool for crate registry backup/export https://shipyard.rs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

# load any variables in .env
2 years ago
set dotenv-load := true
# version of rustc used for cargo commands
2 years ago
rustc-version := "nightly"
# name of crate registry to publish versions of this tool to
2 years ago
publish-registry := "shipyard-rs-public"
# env settings exported for cargo settings
2 years ago
export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -C target-cpu=native"
# cargo wrapper; executes a cargo command using the settings in justfile (RUSTFLAGS, etc.)
2 years ago
cargo +args='':
cargo +{{rustc-version}} {{args}}
# cargo check wrapper
2 years ago
check +args='':
@just cargo check {{args}}
# cargo test wrapper
2 years ago
test +args='':
just cargo test {{args}}
# cargo build wrapper - builds registry-backup in debug mode
2 years ago
debug-build +args='':
@just cargo build --bin registry-backup {{args}}
# cargo build --release wrapper - builds registry-backup in release mode
2 years ago
release-build +args='':
@just cargo build --bin registry-backup --release {{args}}
# generate updated README.md
generate-readme:
just debug-build
./target/debug/registry-backup --help > doc/cli-menu.txt
just --list > doc/just-commands.txt
just cargo run --bin generate-readme --features docs > README.md
# check, run tests, check non-error output for clippy, run rustfmt
pre-release:
just cargo check \
&& just cargo test \
&& just cargo clippy \
&& just cargo fmt
2 years ago
# verify no uncommitted changes
verify-clean-git:
test "$(echo `git status --porcelain` | wc -c)" -eq "1"
2 years ago
get-crate-version:
cat Cargo.toml | rg '^version =' | tr -d "version = " | tr -d '"'
2 years ago
release-prep:
just verify-clean-git
just pre-release
VERSION=$(just get-crate-version) \
&& test -z "$(git tag | rg \"v${VERSION}\")" # Error: tag appears to exist already
just generate-readme
2 years ago
release: release-prep
just verify-clean-git || ( git add README.md doc/*.txt && git commit -m 'update docs' )
git tag "v$(just get-crate-version)"
git push && git push --tags