summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tools/registry/mod.rs18
-rw-r--r--cli/tools/registry/paths.rs2
-rw-r--r--cli/tools/registry/tar.rs1
-rw-r--r--tests/testdata/publish/successful_provenance.out2
4 files changed, 12 insertions, 11 deletions
diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs
index 586327821..1a7a78131 100644
--- a/cli/tools/registry/mod.rs
+++ b/cli/tools/registry/mod.rs
@@ -473,7 +473,7 @@ impl PublishPreparer {
publish_paths.push(CollectedPublishPath {
specifier: ModuleSpecifier::from_file_path(&license_path)
.unwrap(),
- relative_path: "LICENSE".to_string(),
+ relative_path: "/LICENSE".to_string(),
maybe_content: Some(std::fs::read(&license_path).with_context(
|| format!("failed reading '{}'.", license_path.display()),
)?),
@@ -1014,14 +1014,6 @@ async fn publish_package(
);
}
- log::info!(
- "{} @{}/{}@{}",
- colors::green("Successfully published"),
- package.scope,
- package.package,
- package.version
- );
-
let enable_provenance = std::env::var("DISABLE_JSR_PROVENANCE").is_err()
&& (auth::is_gha() && auth::gha_oidc_token().is_some() && provenance);
@@ -1072,6 +1064,14 @@ async fn publish_package(
}
log::info!(
+ "{} @{}/{}@{}",
+ colors::green("Successfully published"),
+ package.scope,
+ package.package,
+ package.version
+ );
+
+ log::info!(
"{}",
colors::gray(format!(
"Visit {}@{}/{}@{} for details",
diff --git a/cli/tools/registry/paths.rs b/cli/tools/registry/paths.rs
index 5943e0cbb..8b6c05fc0 100644
--- a/cli/tools/registry/paths.rs
+++ b/cli/tools/registry/paths.rs
@@ -214,7 +214,7 @@ pub enum PackagePathValidationError {
pub struct CollectedPublishPath {
pub specifier: ModuleSpecifier,
pub path: PathBuf,
- /// Relative path to use in the tarball.
+ /// Relative path to use in the tarball. This should be prefixed with a `/`.
pub relative_path: String,
/// Specify the contents for any injected paths.
pub maybe_content: Option<Vec<u8>>,
diff --git a/cli/tools/registry/tar.rs b/cli/tools/registry/tar.rs
index 27e416537..aca125e00 100644
--- a/cli/tools/registry/tar.rs
+++ b/cli/tools/registry/tar.rs
@@ -64,6 +64,7 @@ pub fn create_gzipped_tarball(
hash: format!("sha256-{:x}", sha2::Sha256::digest(&content)),
size: content.len(),
});
+ assert!(path_str.starts_with('/'));
tar
.add_file(format!(".{}", path_str), &content)
.with_context(|| {
diff --git a/tests/testdata/publish/successful_provenance.out b/tests/testdata/publish/successful_provenance.out
index 512efcff0..dfc827544 100644
--- a/tests/testdata/publish/successful_provenance.out
+++ b/tests/testdata/publish/successful_provenance.out
@@ -2,6 +2,6 @@ Check file:///[WILDCARD]/publish/successful/mod.ts
Checking for slow types in the public API...
Check file:///[WILDCARD]/publish/successful/mod.ts
Publishing @foo/bar@1.0.0 ...
-Successfully published @foo/bar@1.0.0
Provenance transparency log available at https://search.sigstore.dev/?logIndex=42069
+Successfully published @foo/bar@1.0.0
Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details