diff --git a/Cargo.lock b/Cargo.lock index a4ff9f9..40f138e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2210,7 +2210,7 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "television" -version = "0.11.8" +version = "0.11.9" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 7b5e9f7..42a9a10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "television" -version = "0.11.8" +version = "0.11.9" edition = "2021" description = "A cross-platform, fast and extensible general purpose fuzzy finder TUI." license = "MIT" diff --git a/justfile b/justfile index b4b86cf..60baea2 100644 --- a/justfile +++ b/justfile @@ -87,15 +87,35 @@ update-man: build #!/usr/bin/env sh echo "Checking for manpages updates..." if ! diff ./man/tv.1 ./target/assets/tv.1 > /dev/null; - then cp ./target/assets/tv.1 ./man/tv.1 && echo "Updated manpages" + then cp ./target/assets/tv.1 ./man/tv.1 && git add ./man/tv.1 && echo "Updated manpages" else echo "No changes to manpages" fi +publish: + echo "Publishing {{ NAME }}..." + cargo publish --all-features + echo "Done" + +commit-release: + #!/usr/bin/env sh + version=$(grep -E '^\s*version\s*=' Cargo.toml | cut -d '"' -f 2) + git commit -am "chore: release version $version" + git tag "$version" + alias rl := release # Publish a new release (major, minor, or patch) -release kind='patch': - #!/usr/bin/env sh +@release kind='patch': echo "Releasing {{ NAME }} (kind: {{ kind }})..." + just bump-version {{ kind }} + just update-man + just commit-release + just publish + + +# Bump version +bump-version kind='patch': + #!/usr/bin/env sh + echo "Bumping version (kind: {{ kind }})..." # bump version (major, minor, patch) version=$(grep -E '^\s*version\s*=' Cargo.toml | cut -d '"' -f 2) kind="{{ kind }}" @@ -110,8 +130,12 @@ release kind='patch': echo "Invalid kind: $kind" exit 1 fi - echo "New version is: $new_version" - sed -i "s/version = \"$version\"/version = \"$new_version\"/" Cargo.toml + echo "Bumping to: $new_version" + echo "Updating version in Cargo.toml..." + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s/version = \"$version\"/version = \"$new_version\"/" Cargo.toml + else + sed -i "s/version = \"$version\"/version = \"$new_version\"/" Cargo.toml + fi git add Cargo.toml echo "Done" -