Skip to content

Commit

Permalink
Add rclone (#511)
Browse files Browse the repository at this point in the history
* Add rclone

* fix cspell

* specify bin dir
  • Loading branch information
jayvdb committed Jun 8, 2024
1 parent 16647ab commit 66c4dcc
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protoc
pubkey
pwsh
quickinstall
rclone
rdme
sccache
syft
Expand Down
1 change: 1 addition & 0 deletions TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ If a tool not included in the list below is specified, this action uses [cargo-b
| [**osv-scanner**](https://github.com/google/osv-scanner) | `/usr/local/bin` | [GitHub Releases](https://github.com/google/osv-scanner/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/google/osv-scanner/blob/main/LICENSE) |
| [**parse-changelog**](https://github.com/taiki-e/parse-changelog) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/taiki-e/parse-changelog/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/taiki-e/parse-changelog/blob/main/LICENSE-MIT) |
| [**protoc**](https://github.com/protocolbuffers/protobuf) | `/usr/local/bin` | [GitHub Releases](https://github.com/protocolbuffers/protobuf/releases) | Linux, macOS, Windows | [BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE) |
| [**rclone**](https://github.com/rclone/rclone) | `/usr/local/bin` | [GitHub Releases](https://github.com/rclone/rclone/releases) | Linux, macOS, Windows | [MIT](https://github.com/rclone/rclone/blob/master/COPYING) |
| [**sccache**](https://github.com/mozilla/sccache) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/mozilla/sccache/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/mozilla/sccache/blob/main/LICENSE) |
| [**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) |
Expand Down
59 changes: 59 additions & 0 deletions manifests/rclone.json

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

31 changes: 31 additions & 0 deletions tools/codegen/base/rclone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"repository": "https://github.com/rclone/rclone",
"tag_prefix": "v",
"version_range": ">= 1.66.0",
"platform": {
"x86_64_linux_musl": {
"asset_name": "${package}-v${version}-linux-amd64.zip",
"bin": "${package}-v${version}-linux-amd64/${package}"
},
"x86_64_macos": {
"asset_name": "${package}-v${version}-osx-amd64.zip",
"bin": "${package}-v${version}-osx-amd64/${package}"
},
"x86_64_windows": {
"asset_name": "${package}-v${version}-windows-amd64.zip",
"bin": "${package}-v${version}-windows-amd64/${package}${exe}"
},
"aarch64_linux_musl": {
"asset_name": "${package}-v${version}-linux-arm64.zip",
"bin": "${package}-v${version}-linux-arm64/${package}"
},
"aarch64_macos": {
"asset_name": "${package}-v${version}-osx-arm64.zip",
"bin": "${package}-v${version}-osx-arm64/${package}"
},
"aarch64_windows": {
"asset_name": "${package}-v${version}-windows-arm64.zip",
"bin": "${package}-v${version}-windows-arm64/${package}${exe}"
}
}
}
11 changes: 8 additions & 3 deletions tools/codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ fn main() -> Result<()> {
fs::create_dir_all(manifest_path.parent().unwrap())?;
fs::create_dir_all(download_cache_dir)?;

eprintln!("download cache: {}", download_cache_dir.display());

let mut base_info: BaseManifest = serde_json::from_slice(&fs::read(
workspace_root.join("tools/codegen/base").join(format!("{package}.json")),
)?)?;
Expand Down Expand Up @@ -722,9 +724,12 @@ fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String)
license_id.name.to_string()
};
let name = license_id.name.split('-').next().unwrap().to_ascii_uppercase();
for filename in
["LICENSE".to_string(), format!("LICENSE-{name}"), "LICENSE.md".to_string()]
{
for filename in [
"LICENSE".to_string(),
format!("LICENSE-{name}"),
"LICENSE.md".to_string(),
"COPYING".to_string(),
] {
let url = create_github_raw_link(repo, default_branch, &filename);
if github_head(&url).is_ok() {
let url = create_github_link(repo, default_branch, &filename);
Expand Down

0 comments on commit 66c4dcc

Please sign in to comment.