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 diff --git a/.gitignore b/.gitignore index ea8c4bf..81cf465 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/.vscode 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) diff --git a/src/artifact_choosing.rs b/src/artifact_choosing.rs index e1b7fc5..0cc90ac 100644 --- a/src/artifact_choosing.rs +++ b/src/artifact_choosing.rs @@ -1,8 +1,18 @@ #[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"];