Skip to content

Commit

Permalink
feat(basic): workspace support
Browse files Browse the repository at this point in the history
  • Loading branch information
bengreenier committed Oct 29, 2021
1 parent 914a396 commit 21faef2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Expand Up @@ -10,8 +10,8 @@ Cargo.lock
**/*.rs.bk

# Ignore CI-created directories in case you're running CI locally with act
single-crate-bin/
single-crate-lib/
basic-bin-true/
basic-bin-false/
basic-lib-true/
basic-lib-false/
workflow/
workspace-bin/
workspace-lib/
3 changes: 1 addition & 2 deletions basic/Cargo.toml
Expand Up @@ -8,8 +8,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

{% if workspace %}
[workspace]
members = []
{% endif %}
{% endif %}
14 changes: 13 additions & 1 deletion basic/Justfile
Expand Up @@ -3,10 +3,16 @@

_default:
@just --list


{% if workspace %}
# Installs tools needed for other `just` recipes
install-tools:
cargo install cargo-hack cargo-bump cargo-workspaces
{% else %}
# Installs tools needed for other `just` recipes
install-tools:
cargo install cargo-hack cargo-bump
{% endif %}

# Checks (using `clippy`) all crates across all features
check:
Expand All @@ -20,6 +26,12 @@ test:
set-version version:
cargo bump {{version}}

{% if workspace %}
# Attempts to publish the crate using `cargo workspaces`
publish:
cargo workspaces publish --from-git --no-git-commit --no-git-push --no-git-tag -y
{% else %}
# Attempts to publish the crate using `cargo`
publish:
cargo publish
{% endif %}

0 comments on commit 21faef2

Please sign in to comment.