feat(unstable): define config in publish url (#22406)

This commit is contained in:
Leo Kettmeir 2024-02-14 12:53:15 +01:00 committed by GitHub
parent e23fc6d88c
commit 981a19f067
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -68,6 +68,7 @@ struct PreparedPublishPackage {
package: String,
version: String,
tarball: PublishableTarball,
config: String,
}
impl PreparedPublishPackage {
@ -158,6 +159,13 @@ async fn prepare_publish(
package: package_name.to_string(),
version: version.to_string(),
tarball,
// the config file is always at the root of a publishing dir,
// so getting the file name is always correct
config: config_path
.file_name()
.unwrap()
.to_string_lossy()
.to_string(),
}))
}
@ -541,8 +549,12 @@ async fn publish_package(
);
let url = format!(
"{}scopes/{}/packages/{}/versions/{}",
registry_api_url, package.scope, package.package, package.version
"{}scopes/{}/packages/{}/versions/{}?config=/{}",
registry_api_url,
package.scope,
package.package,
package.version,
package.config
);
let response = client