Skip to content

Commit

Permalink
build: add release script to Justfile (#22)
Browse files Browse the repository at this point in the history
DonIsaac authored Sep 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c583e22 commit 77add0e
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
@@ -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
@@ -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 77add0e

Please sign in to comment.