feat: upgrades (#26)

- Add rustfmt file
- Add .cargo file for fast compiles
- use just commands and cleanup release workflows
This commit is contained in:
Hikari (ひかり) 2024-01-27 18:07:03 -06:00 committed by GitHub
parent d347071dde
commit 7006cd3e2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 107 additions and 70 deletions

View file

@ -2,37 +2,59 @@
export RUST_BACKTRACE := "1"
set shell := ["bash", "-cu"]
set dotenv-load := true
set shell := ["bash", "-cu"]
set positional-arguments := true
# default recipe to display help information
default:
@just --list
cargo_bump_release_test:
#!/usr/bin/env bash
set -euxo pipefail
# release: remove the dev suffix, like going from 0.X.0-dev to 0.X.0
# --workspace: updating all crates in the workspace
# --no-publish: do not publish to crates.io
# --execute: not a dry run
# --no-tag: do not push tag for each new version
# --no-push: do not push the update commits
# --dependent-version upgrade: change 0.X.0-dev in internal dependencies to 0.X.0
# --exclude: ignore those packages
cargo-release *args:
#!/usr/bin/env bash
set -euo pipefail
# Read the current version from Cargo.toml
current_version=$(cargo metadata --format-version 1 --no-deps | \
jq --raw-output '.packages | .[] | select(.name == "blue-build").version')
echo "Current Version: $current_version"
# Sanity check: current version should be 0.X.Y
if ! grep -q '^0\.[0-9]\+\.[0-9]\+$' <<< "${current_version}"; then
echo "Invalid version (not in 0.X.Y format): ${current_version}"
exit 1
fi
minor_version=$(sed 's/^0\.\([0-9]\+\).*/\1/' <<< "${current_version}")
next_version=0.$((minor_version + 1)).0-dev
echo "Bumping version to ${next_version}"
# See release.yml for meaning of these arguments
cargo release "${next_version}" \
cargo release release -v \
--workspace \
--no-publish \
--no-tag \
--no-confirm \
--no-push
--no-push \
--dependent-version upgrade "$@"
# See @cargo-release for meaning of cargo-release arguments
cargo-post-release *args:
#!/usr/bin/env bash
set -euo pipefail
# Read the current version from Cargo.toml
current_version=$(cargo metadata --format-version 1 --no-deps | \
jq --raw-output '.packages | .[] | select(.name == "blue-build").version')
echo "Current Version: $current_version"
# Sanity check: current version should be 0.X.Y
if ! grep -q '^0\.[0-9]\+\.[0-9]\+$' <<< "${current_version}"; then
echo "Invalid version (not in 0.X.Y format): ${current_version}"
exit 1
fi
minor_version=$(sed 's/^0\.\([0-9]\+\).*/\1/' <<< "${current_version}")
next_version=0.$((minor_version + 1)).0-dev
echo "Bumping version to ${next_version}"
# See @cargo-release for meaning of these arguments
cargo release -v "${next_version}" \
--workspace \
--no-publish \
--no-tag \
--no-confirm \
--no-push "$@"