Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: host should use web_url() #1024

Merged
merged 4 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cargo-dist/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ pub(crate) fn select_hosting(
let hosting_providers = hosting
.clone()
.or_else(|| Some(vec![ci.as_ref()?.first()?.native_hosting()?]))?;
let repo_url = workspace.repository_url.as_ref()?;
let repo_url = workspace.web_url().unwrap_or_default()?;
// Currently there's only one supported sourcehost provider
let repo = workspace.github_repo().unwrap_or_default()?;

Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/tests/gallery/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub static AXOLOTLSAY: TestContextLock<Tools> = TestContextLock::new(
&Repo {
repo_owner: "axodotdev",
repo_name: "axolotlsay",
commit_sha: "403a65095fccf77380896d0f3c85000e0a1bec69",
commit_sha: "470fef1c2e1aecc35b1c8a704960d558906c58ff",
app_name: "axolotlsay",
bins: &["axolotlsay"],
},
Expand Down
36 changes: 0 additions & 36 deletions cargo-dist/tests/integration-tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,42 +987,6 @@ targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows
})
}

#[test]
fn akaikatana_repo_with_dot_git() -> Result<(), miette::Report> {
let test_name = _function_name!();
AKAIKATANA_REPACK.run_test(|ctx| {
let dist_version = ctx.tools.cargo_dist.version().unwrap();

// Same as above, except we set a repository path with .git.
// We rely on the snapshot to test that the output looks right.
ctx.patch_cargo_toml(format!(r#"
[package]
repository = "https://github.com/mistydemeo/akaikatana-repack.git"

[workspace.metadata.dist]
cargo-dist-version = "{dist_version}"
rust-toolchain-version = "1.67.1"
ci = ["github"]
installers = ["shell", "powershell", "homebrew"]
tap = "mistydemeo/homebrew-formulae"
publish-jobs = ["homebrew"]
targets = ["x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin"]

"#
))?;

// Run generate to make sure stuff is up to date before running other commands
let ci_result = ctx.cargo_dist_generate(test_name)?;
let ci_snap = ci_result.check_all()?;
// Do usual build+plan checks
let main_result = ctx.cargo_dist_build_and_plan(test_name)?;
let main_snap = main_result.check_all(ctx, ".cargo/bin/")?;
// snapshot all
main_snap.join(ci_snap).snap();
Ok(())
})
}

#[test]
fn install_path_cargo_home() -> Result<(), miette::Report> {
let test_name = _function_name!();
Expand Down
Loading
Loading