Skip to content

Commit

Permalink
cargo: explicitly indicate paths to publish
Browse files Browse the repository at this point in the history
Running `cargo publish` from a non-colocated repo (such as my usual
repo) is currently quite scary because it uploads all non-hidden
files, even if they're ignored by `.gitignore`
(rust-lang/cargo#2063). I noticed this a
while ago and have always run the command from a fresh clone since
then. To avoid the need for that, let's use the workaround mentioned
on the bug, which is to explicitly list patterns we want to publish.
  • Loading branch information
martinvonz committed Apr 16, 2024
1 parent 955c9bf commit 8ce0994
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ repository = { workspace = true }
documentation = { workspace = true }
keywords = { workspace = true }

include = [
"/LICENSE",
"/build.rs",
"/examples/",
"/src/",
"/testing/",
"/tests/",
"!*.pending-snap",
"!*.snap*",
"/tests/[email protected]"
]

[[bin]]
name = "jj"
path = "src/main.rs"
Expand Down
10 changes: 10 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ repository = { workspace = true }
documentation = { workspace = true }
readme = { workspace = true }

include = [
"/LICENSE",
"/benches/",
"/src/",
"/tests/",
"!*.pending-snap",
"!*.snap*",
]


[[test]]
name = "runner"

Expand Down
2 changes: 2 additions & 0 deletions lib/proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ repository = { workspace = true }
documentation = { workspace = true }
readme = { workspace = true }

include = ["/LICENSE", "/src/"]

[lib]
proc-macro = true

Expand Down

0 comments on commit 8ce0994

Please sign in to comment.