On my side it was because i used the include key of Cargo.toml (https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields)
[package]
name = "package"
include = ["folder/"]
warning: ignoring library `package` as `src/lib.rs` is not included in the published package
warning: ignoring binary `package` as `src/main.rs` is not included in the published package
error: failed to prepare local package for uploading
Caused by:
no targets specified in the manifest
either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present
[package]
name = "package"
include = ["LICENSE", "**/*.rs", "folder/", "Cargo.toml"]