Skip to content

Commit

Permalink
build: add release script to Justfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Sep 18, 2024
1 parent c583e22 commit d329134
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _default:
alias f := fix
alias l := lint

version := `tq -f Cargo.toml 'package.version'`

# Install tools needed for development. Make sure cargo-binstall is installed first.
init:
cargo binstall cargo-shear taplo-cli typos-cli -y
Expand All @@ -25,3 +27,23 @@ fix:
cargo clippy --no-deps --all-targets --all-features --fix --allow-staged
just fmt
git status

# Make a release. `semver_kind` is major/minor/patch
#
# requires these tools:
# - cargo-bump: https://github.com/wraithan/cargo-bump
# - tomlq: https://github.com/cryptaliagy/tomlq
release semver_kind:
# bail on uncommitted changes
git diff --exit-code --name-only
# replace package.version in Cargo.toml
cargo bump {{semver_kind}}
# update Cargo.lock
cargo check
@echo Creating release: {{version}}
git add Cargo.toml Cargo.lock
git commit -m "release: {{version}}"
git tag v{{version}}
git push --tags
cargo publish

0 comments on commit d329134

Please sign in to comment.