Skip to content

Commit

Permalink
Merge pull request #4352 from wasmerio/improve-publish-cmd
Browse files Browse the repository at this point in the history
Wait for webc, bindings, exe generation during package-publish with `--wait` flag
  • Loading branch information
Michael Bryan authored Jan 4, 2024
2 parents 743bee2 + 2b272d5 commit b914717
Show file tree
Hide file tree
Showing 14 changed files with 712 additions and 68 deletions.
96 changes: 92 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/cli/src/commands/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ pub struct Publish {
///
/// Note that this is not the timeout for the entire publish process, but
/// for each individual query to the registry during the publish flow.
#[clap(long, default_value = "30s")]
#[clap(long, default_value = "2m")]
pub timeout: humantime::Duration,
}

impl Publish {
/// Executes `wasmer publish`
pub fn execute(&self) -> Result<(), anyhow::Error> {
#[tokio::main]
pub async fn execute(&self) -> Result<(), anyhow::Error> {
let token = self
.env
.token()
Expand All @@ -58,7 +59,7 @@ impl Publish {
wait: self.wait,
timeout: self.timeout.into(),
};
publish.execute().map_err(on_error)?;
publish.execute().await.map_err(on_error)?;

if let Err(e) = invalidate_graphql_query_cache(&self.env) {
tracing::warn!(
Expand Down
7 changes: 5 additions & 2 deletions lib/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ dialoguer = "0.11.0"
dirs = "4.0.0"
filetime = "0.2.19"
flate2 = "1.0.24"
futures = "0.3"
futures-util = "0.3.25"
graphql_client = "0.11.0"
graphql-ws-client = {version = "0.6.0", features = ["client-graphql-client"]}
graphql_client = "0.13.0"
hex = "0.4.3"
indexmap = { version = "1.9.3", optional = true }
indicatif = "0.17.2"
Expand All @@ -41,7 +43,8 @@ tempfile = "3.6.0"
thiserror = "1.0.37"
time = { version = "0.3.17", default-features = false, features = ["parsing", "std", "formatting"], optional = true }
tldextract = "0.6.0"
tokio = "1.24.0"
tokio = {version = "1"}
tokio-tungstenite = {version = "0.20", features = ["rustls-tls-native-roots"]}
toml = "0.5.9"
tracing = "0.1.40"
url = "2.3.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mutation PublishPackageMutationChunked(
) {
success
packageVersion {
id
version
}
}
Expand Down
Loading

0 comments on commit b914717

Please sign in to comment.