Skip to content
Draft
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
3 changes: 3 additions & 0 deletions TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ If a tool not included in the list below is specified, this action uses [cargo-b
| [**cargo-valgrind**](https://github.com/jfrimmel/cargo-valgrind) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/jfrimmel/cargo-valgrind/releases) | Linux, macOS, Windows | [MIT](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/jfrimmel/cargo-valgrind/blob/master/LICENSE-APACHE) |
| [**cargo-zigbuild**](https://github.com/rust-cross/cargo-zigbuild) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-cross/cargo-zigbuild/releases) | Linux, macOS, Windows | [MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE) |
| [**cross**](https://github.com/cross-rs/cross) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/cross-rs/cross/releases) | Linux, macOS, Windows | [MIT](https://github.com/cross-rs/cross/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/cross-rs/cross/blob/main/LICENSE-APACHE) |
| [**curl**](https://github.com/curl/curl) | `/usr/bin` | [distro package](https://repology.org/project/curl/versions) | Linux | [curl](https://github.com/curl/curl/blob/master/COPYING) |
| [**dprint**](https://github.com/dprint/dprint) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/dprint/dprint/releases) | Linux, macOS, Windows | [MIT](https://github.com/dprint/dprint/blob/main/LICENSE) |
| [**editorconfig-checker**](https://github.com/editorconfig-checker/editorconfig-checker) | `/usr/local/bin` | [GitHub Releases](https://github.com/editorconfig-checker/editorconfig-checker/releases) | Linux, macOS, Windows | [MIT](https://github.com/editorconfig-checker/editorconfig-checker/blob/main/LICENSE) |
| [**espup**](https://github.com/esp-rs/espup) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/esp-rs/espup/releases) | Linux, macOS, Windows | [MIT](https://github.com/esp-rs/espup/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/esp-rs/espup/blob/main/LICENSE-APACHE) |
| [**git-cliff**](https://github.com/orhun/git-cliff) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/orhun/git-cliff/releases) | Linux, macOS, Windows | [MIT](https://github.com/orhun/git-cliff/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/orhun/git-cliff/blob/main/LICENSE-APACHE) |
| [**grcov**](https://github.com/mozilla/grcov) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/grcov/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/mozilla/grcov/blob/HEAD/LICENSE-MPL-2.0) |
| [**hyperfine**](https://github.com/sharkdp/hyperfine) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/sharkdp/hyperfine/releases) | Linux, macOS, Windows | [MIT](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/sharkdp/hyperfine/blob/master/LICENSE-APACHE) |
| [**jaq**](https://github.com/01mf02/jaq) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/01mf02/jaq/releases) | Linux, macOS, Windows | [MIT](https://github.com/01mf02/jaq/blob/main/LICENSE-MIT) |
| [**jq**](https://github.com/jqlang/jq) | `/usr/bin` | [distro package](https://repology.org/project/jq/versions) | Linux, Windows | [MIT AND ICU AND CC-BY-3.0](https://github.com/jqlang/jq/blob/master/jq.spec#L9) |
| [**just**](https://github.com/casey/just) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/casey/just/releases) | Linux, macOS, Windows | [CC0-1.0](https://github.com/casey/just/blob/master/LICENSE) |
| [**mdbook**](https://github.com/rust-lang/mdBook) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rust-lang/mdBook/releases) | Linux, macOS, Windows | [MPL-2.0](https://github.com/rust-lang/mdBook/blob/master/LICENSE) |
| [**mdbook-linkcheck**](https://github.com/Michael-F-Bryan/mdbook-linkcheck) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases) | Linux, macOS, Windows | [MIT](https://github.com/Michael-F-Bryan/mdbook-linkcheck/blob/master/LICENSE) |
Expand All @@ -52,6 +54,7 @@ If a tool not included in the list below is specified, this action uses [cargo-b
| [**shellcheck**](https://www.shellcheck.net) | `/usr/local/bin` | [GitHub Releases](https://github.com/koalaman/shellcheck/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/koalaman/shellcheck/blob/master/LICENSE) |
| [**shfmt**](https://github.com/mvdan/sh) | `/usr/local/bin` | [GitHub Releases](https://github.com/mvdan/sh/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/mvdan/sh/blob/master/LICENSE) |
| [**syft**](https://github.com/anchore/syft) | `/usr/local/bin` | [GitHub Releases](https://github.com/anchore/syft/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/anchore/syft/blob/main/LICENSE) |
| [**tar**](https://www.gnu.org/software/tar/) | `/usr/bin` | [distro package](https://repology.org/project/tar/versions) | Linux | [GPL-3.0-or-later](https://git.savannah.gnu.org/cgit/tar.git/tree/COPYING) |
| [**typos**](https://github.com/crate-ci/typos) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/crate-ci/typos/releases) | Linux, macOS, Windows | [MIT](https://github.com/crate-ci/typos/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/crate-ci/typos/blob/master/LICENSE-APACHE) |
| [**valgrind**](https://valgrind.org/) | `/snap/bin` | [snap](https://snapcraft.io/install/valgrind/ubuntu) | Linux | [GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD) |
| [**wait-for-them**](https://github.com/shenek/wait-for-them) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/shenek/wait-for-them/releases) | Linux, macOS, Windows | [GPL-3.0](https://github.com/shenek/wait-for-them/blob/v0.4.0/Cargo.toml#L7) |
Expand Down
80 changes: 65 additions & 15 deletions tools/codegen/src/tools-markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,55 @@ fn main() -> Result<()> {
fs::read_dir(manifest_dir.clone()).unwrap().map(|r| r.unwrap()).collect();
paths.sort_by_key(fs_err::DirEntry::path);

let mut tools = vec![MarkdownEntry {
name: "valgrind".to_string(),
alias: None,
website: "https://valgrind.org/".to_string(),
installed_to: InstalledTo::Snap,
installed_from: InstalledFrom::Snap,
platforms: Platforms { linux: true, ..Default::default() },
repository: "https://sourceware.org/git/valgrind.git".to_string(),
license_markdown:
"[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)"
let mut tools = vec![
MarkdownEntry {
name: "valgrind".to_string(),
alias: None,
website: "https://valgrind.org/".to_string(),
installed_to: InstalledTo::Snap,
installed_from: InstalledFrom::Snap,
platforms: Platforms { linux: true, ..Default::default() },
repository: "https://sourceware.org/git/valgrind.git".to_string(),
license_markdown:
"[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)"
.to_string(),
},
MarkdownEntry {
name: "jq".to_string(),
alias: None,
website: "https://github.com/jqlang/jq".to_string(),
installed_to: InstalledTo::UsrBin,
installed_from: InstalledFrom::DistroPackage,
platforms: Platforms { linux: true, windows: true, macos: false },
repository: "https://github.com/jqlang/jq".to_string(),
license_markdown:
"[MIT AND ICU AND CC-BY-3.0](https://github.com/jqlang/jq/blob/master/jq.spec#L9)"
.to_string(),
},
MarkdownEntry {
name: "curl".to_string(),
alias: None,
website: "https://github.com/curl/curl".to_string(),
installed_to: InstalledTo::UsrBin,
installed_from: InstalledFrom::DistroPackage,
platforms: Platforms { linux: true, ..Default::default() },
repository: "https://github.com/curl/curl".to_string(),
license_markdown: "[curl](https://github.com/curl/curl/blob/master/COPYING)"
.to_string(),
}];
},
MarkdownEntry {
name: "tar".to_string(),
alias: None,
website: "https://www.gnu.org/software/tar/".to_string(),
installed_to: InstalledTo::UsrBin,
installed_from: InstalledFrom::DistroPackage,
platforms: Platforms { linux: true, ..Default::default() },
repository: "https://git.savannah.gnu.org/cgit/tar.git".to_string(),
license_markdown:
"[GPL-3.0-or-later](https://git.savannah.gnu.org/cgit/tar.git/tree/COPYING)"
.to_string(),
},
];

for path in paths {
let file_name = path.file_name();
Expand All @@ -76,8 +113,11 @@ fn main() -> Result<()> {

let repository = base_info.repository;

let installed_to =
if manifests.rust_crate.is_some() { InstalledTo::Cargo } else { InstalledTo::UsrLocal };
let installed_to = if manifests.rust_crate.is_some() {
InstalledTo::Cargo
} else {
InstalledTo::UsrLocalBin
};

let installed_from = InstalledFrom::GitHubRelease;
let mut platforms = Platforms::default();
Expand Down Expand Up @@ -141,6 +181,7 @@ struct MarkdownEntry {
enum InstalledFrom {
GitHubRelease,
Snap,
DistroPackage,
}

#[derive(Debug, Default, Eq, PartialEq)]
Expand Down Expand Up @@ -172,15 +213,17 @@ impl fmt::Display for Platforms {
enum InstalledTo {
Cargo,
Snap,
UsrLocal,
UsrBin,
UsrLocalBin,
}

impl fmt::Display for InstalledTo {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
InstalledTo::Cargo => f.write_str("`$CARGO_HOME/bin`")?,
InstalledTo::Snap => f.write_str("`/snap/bin`")?,
InstalledTo::UsrLocal => f.write_str("`/usr/local/bin`")?,
InstalledTo::UsrBin => f.write_str("`/usr/bin`")?,
InstalledTo::UsrLocalBin => f.write_str("`/usr/local/bin`")?,
}

Ok(())
Expand All @@ -204,6 +247,13 @@ impl fmt::Display for MarkdownEntry {
let markdown = format!("| [GitHub Releases]({}/releases) ", self.repository);
f.write_str(&markdown)?;
}
InstalledFrom::DistroPackage => {
let markdown = format!(
"| [distro package](https://repology.org/project/{}/versions) ",
self.name
);
f.write_str(&markdown)?;
}
InstalledFrom::Snap => {
let markdown =
format!("| [snap](https://snapcraft.io/install/{}/ubuntu) ", self.name);
Expand Down