Skip to content

Commit

Permalink
Update cargo-dist config and build script (#314)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Oct 30, 2023
1 parent d497469 commit 7a659cf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 222 deletions.
16 changes: 15 additions & 1 deletion Cargo.lock

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

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ rust-version = "1.70"
repository = "https://github.com/cncf/landscape2"
authors = ["Sergio Castaño Arteaga", "Cintia Sanchez Garcia"]

[package.metadata.wix]
upgrade-guid = "8B8B47D4-B0F2-4755-9288-1C5FCFCA9F92"
path-guid = "5A454C4A-3A81-4F07-91A2-D8A181CC98B7"

[dependencies]
anyhow = "1.0.75"
askama = { version = "0.12.1", features = ["serde-json"] }
Expand Down Expand Up @@ -66,6 +62,7 @@ mockall = "0.11.4"

[build-dependencies]
anyhow = "1.0.75"
which = "5.0.0"

# The profile that 'cargo dist' will build with
[profile.dist]
Expand All @@ -79,11 +76,11 @@ cargo-dist-version = "0.4.0"
# CI backends to support
ci = ["github"]
# The installers to generate for each app
installers = ["shell", "powershell", "homebrew", "msi"]
installers = ["shell", "homebrew"]
# A GitHub repo to push Homebrew formulas to
tap = "cncf/homebrew-landscape2"
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-musl"]
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
# Publish jobs to run in CI
Expand Down
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
use anyhow::{format_err, Result};
use std::process::{Command, Output};
use which::which;

fn main() -> Result<()> {
// Tell Cargo to rerun this build script if the web app changes
println!("cargo:rerun-if-changed=web/src");
println!("cargo:rerun-if-changed=web/static");
println!("cargo:rerun-if-changed=web/index.html");

// Check if required external tools are available
if which("yarn").is_err() {
return Err(format_err!(
"yarn not found in PATH (it is required to build the web application)"
));
}

// Build web application
let error = |cmd: &str, output: Output| {
Err(format_err!(
Expand Down
215 changes: 0 additions & 215 deletions wix/main.wxs

This file was deleted.

0 comments on commit 7a659cf

Please sign in to comment.