Skip to content

Commit 714ab53

Browse files
authored
feat(cargo-shuttle): add macos aarch64 binary, upgrade macos builder (#2085)
* ci: build macos release on m4 * test * wip: add macos aarch64 build * logic * test release binary * nit * restore ci config
1 parent f3c3766 commit 714ab53

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

.circleci/config.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
- run: sudo apt update && sudo DEBIAN_FRONTEND=noninteractive apt install -y libssl-dev musl-tools clang
276276
- run:
277277
name: Install Rust
278-
# Note: Let binary build use latest
278+
# Note: Let binary build use latest stable Rust
279279
command: curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | bash -s -- -y --target << parameters.target >>
280280
- run:
281281
name: Build
@@ -296,7 +296,7 @@ jobs:
296296
- checkout
297297
- run:
298298
name: Install Rust
299-
# Note: Let binary build use latest
299+
# Note: Let binary build use latest stable Rust
300300
command: |
301301
choco uninstall rust # The one coming from choco interferes with the one coming from rustup
302302
wget -OutFile "C:\rustup-init.exe" https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
@@ -312,22 +312,30 @@ jobs:
312312
suffix: ".exe"
313313
build-binaries-mac:
314314
macos:
315-
xcode: 15.3.0
316-
resource_class: macos.m1.medium.gen1
315+
xcode: 16.4.0
316+
resource_class: m4pro.medium
317+
parameters:
318+
target:
319+
description: "Macos target to build for"
320+
type: string
317321
steps:
318322
- checkout
319-
# Necessary to build for Intel targets on m1.
320-
- macos/install-rosetta
323+
- when:
324+
condition:
325+
equal: [<< parameters.target >>, "x86_64-apple-darwin"]
326+
steps:
327+
# Necessary to build for x86 targets on apple silicon
328+
- macos/install-rosetta
321329
- run:
322330
name: Install Rust
323-
# Note: Let binary build use latest
324-
command: curl --proto '=https' https://sh.rustup.rs -sSf | bash -s -- -y --target x86_64-apple-darwin
331+
# Note: Let binary build use latest stable Rust
332+
command: curl --proto '=https' https://sh.rustup.rs -sSf | bash -s -- -y --target << parameters.target >>
325333
- run:
326334
name: Build
327335
command: |
328-
cargo build --release --package cargo-shuttle --target x86_64-apple-darwin
336+
cargo build --release --package cargo-shuttle --target << parameters.target >>
329337
- make-artifact:
330-
target: x86_64-apple-darwin
338+
target: << parameters.target >>
331339
publish-github-release-draft:
332340
docker:
333341
- image: cimg/go:1.19.3
@@ -466,6 +474,16 @@ workflows:
466474
tags:
467475
only: /v[\d\.]+/
468476
- build-binaries-mac:
477+
name: build-binaries-mac-x86_64
478+
target: x86_64-apple-darwin
479+
filters:
480+
branches:
481+
ignore: /.*/
482+
tags:
483+
only: /v[\d\.]+/
484+
- build-binaries-mac:
485+
name: build-binaries-mac-aarch64
486+
target: aarch64-apple-darwin
469487
filters:
470488
branches:
471489
ignore: /.*/
@@ -477,7 +495,8 @@ workflows:
477495
- build-binaries-x86_64-musl
478496
- build-binaries-aarch64
479497
- build-binaries-windows
480-
- build-binaries-mac
498+
- build-binaries-mac-x86_64
499+
- build-binaries-mac-aarch64
481500
filters:
482501
branches:
483502
ignore: /.*/

cargo-shuttle/src/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use shuttle_common::{constants::EXAMPLES_REPO, models::resource::ResourceType};
1818
#[command(
1919
version,
2020
next_help_heading = "Global options",
21-
// Cargo passes in the subcommand name to the invoked executable. Use a
22-
// hidden, optional positional argument to deal with it.
21+
// When running 'cargo shuttle', Cargo passes in the subcommand name to the invoked executable.
22+
// Use a hidden, optional positional argument to deal with it.
2323
arg(clap::Arg::new("dummy")
2424
.value_parser([PossibleValue::new("shuttle")])
2525
.required(false)

0 commit comments

Comments
 (0)