From 104a00fcc014b09191f5d51cb2ff090952873151 Mon Sep 17 00:00:00 2001 From: Anton Matosov Date: Wed, 16 Mar 2022 17:28:00 -0700 Subject: [PATCH 1/5] target arch --- src/artifact_choosing.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/artifact_choosing.rs b/src/artifact_choosing.rs index e1b7fc5..49f762c 100644 --- a/src/artifact_choosing.rs +++ b/src/artifact_choosing.rs @@ -1,8 +1,11 @@ #[cfg(target_os = "windows")] static PLATFORM_KEYWORDS: &[&str] = &["win32", "win64", "windows"]; -#[cfg(target_os = "macos")] -static PLATFORM_KEYWORDS: &[&str] = &["macos", "darwin"]; +#[cfg(all(target_os = "macos", target_arch = "x86_64"))] +static PLATFORM_KEYWORDS: &[&str] = &["macos-x86_64", "darwin-x86_64", "macos", "darwin"]; + +#[cfg(all(target_os = "macos", target_arch = "aarch64"))] +static PLATFORM_KEYWORDS: &[&str] = &["macos-arm64", "darwin-arm64", "macos-x86_64", "darwin-x86_64", "macos", "darwin"]; #[cfg(target_os = "linux")] static PLATFORM_KEYWORDS: &[&str] = &["linux"]; From 6254d19b724d8bab92282cb19fb40b96abddb949 Mon Sep 17 00:00:00 2001 From: Anton Matosov Date: Wed, 16 Mar 2022 17:41:47 -0700 Subject: [PATCH 2/5] add arm64 foreman build --- .github/workflows/release.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e954dd..a0144bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,18 +27,32 @@ jobs: - uses: actions/checkout@v1 - name: Install Rust - run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + rustup target install aarch64-apple-darwin + rustup target install x86_64-apple-darwin - - name: Build release binary + - name: Build x86_64 release binary run: | source $HOME/.cargo/env - cargo build --verbose --locked --release + cargo build --verbose --locked --release --target x86_64-apple-darwin - - name: Upload artifacts + - name: Upload x86_64 artifacts + uses: actions/upload-artifact@v1 + with: + name: foreman-macos-x86_64 + path: target/x86_64-apple-darwin/release/foreman + + - name: Build arm64 release binary + run: | + source $HOME/.cargo/env + cargo build --verbose --locked --release --target aarch64-apple-darwin + + - name: Upload arm64 artifacts uses: actions/upload-artifact@v1 with: - name: foreman-macos - path: target/release/foreman + name: foreman-macos-arm64 + path: target/arm64-apple-darwin/release/foreman linux: runs-on: ubuntu-latest From e4669770cf173a257bb849d6bc293315ec6d646c Mon Sep 17 00:00:00 2001 From: Anton Matosov Date: Wed, 16 Mar 2022 18:25:08 -0700 Subject: [PATCH 3/5] format --- src/artifact_choosing.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/artifact_choosing.rs b/src/artifact_choosing.rs index 49f762c..0cc90ac 100644 --- a/src/artifact_choosing.rs +++ b/src/artifact_choosing.rs @@ -5,7 +5,14 @@ static PLATFORM_KEYWORDS: &[&str] = &["win32", "win64", "windows"]; static PLATFORM_KEYWORDS: &[&str] = &["macos-x86_64", "darwin-x86_64", "macos", "darwin"]; #[cfg(all(target_os = "macos", target_arch = "aarch64"))] -static PLATFORM_KEYWORDS: &[&str] = &["macos-arm64", "darwin-arm64", "macos-x86_64", "darwin-x86_64", "macos", "darwin"]; +static PLATFORM_KEYWORDS: &[&str] = &[ + "macos-arm64", + "darwin-arm64", + "macos-x86_64", + "darwin-x86_64", + "macos", + "darwin", +]; #[cfg(target_os = "linux")] static PLATFORM_KEYWORDS: &[&str] = &["linux"]; From e6b9caab0d7ead7db2776436cd174caf85ea4a0e Mon Sep 17 00:00:00 2001 From: Anton Matosov Date: Fri, 18 Mar 2022 14:17:16 -0700 Subject: [PATCH 4/5] ignore .vscode --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ea8c4bf..81cf465 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/.vscode From 5b242b892ed76278e2f9b9910bfb503b618f88dd Mon Sep 17 00:00:00 2001 From: Anton Matosov Date: Fri, 18 Mar 2022 14:20:41 -0700 Subject: [PATCH 5/5] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 296412d..af132d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Foreman Changelog ## Unreleased Changes +- Add support for Apple Silicon (arm64) binaries ([#46](https://github.com/Roblox/foreman/pull/46)) ## 1.0.3 (2022-02-04)