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

Support macos-aarch64 as a platform keyword #60

Merged
merged 5 commits into from
Sep 27, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Support `macos-aarch64` as an artifact name for Apple Silicon (arm64) binaries ([#60](https://github.com/Roblox/foreman/pull/60))
- Take into account architecture when downloading binaries for linux ([#59](https://github.com/Roblox/foreman/pull/59))

## 1.0.4 (2022-05-13)
Expand Down
4 changes: 2 additions & 2 deletions src/artifact_choosing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ static PLATFORM_KEYWORDS: &[&str] = &["macos-x86_64", "darwin-x86_64", "macos",
static PLATFORM_KEYWORDS: &[&str] = &[
"macos-arm64",
"darwin-arm64",
"macos-x86_64",
"darwin-x86_64",
"macos-aarch64",
"darwin-aarch64",
"macos",
"darwin",
];
Expand Down
36 changes: 36 additions & 0 deletions src/tool_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,42 @@ mod test {
assert_eq!(choose_asset(&release, &["linux"]), Some(0));
}

#[test]
fn select_correct_asset_macos() {
let release = Release {
prerelease: false,
tag_name: "v0.5.2".to_string(),
assets: vec![
ReleaseAsset {
name: "tool-linux.zip".to_string(),
url: "https://example.com/some/repo/releases/assets/1".to_string(),
},
ReleaseAsset {
name: "tool-macos-x86_64.zip".to_string(),
url: "https://example.com/some/repo/releases/assets/2".to_string(),
},
ReleaseAsset {
name: "tool-macos-aarch64.zip".to_string(),
url: "https://example.com/some/repo/releases/assets/3".to_string(),
},
],
};
assert_eq!(
choose_asset(
&release,
&[
"macos-arm64",
"darwin-arm64",
"macos-aarch64",
"darwin-aarch64",
"macos",
"darwin",
]
),
Some(2)
);
}

#[test]
fn select_correct_asset_linux() {
let release = Release {
Expand Down