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

added macOS support #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ jobs:
version: << parameters.version >>
- run: *check-cli-version

install-macos:
parameters:
version:
type: string
macos:
xcode: 14.1.0
steps:
- gcp-cli/install:
version: <<parameters.version>>
- run: *check-cli-version

install-components:
executor: gcp-cli/default
steps:
Expand Down Expand Up @@ -114,6 +125,14 @@ workflows:
context: orb-publisher
filters: *filters

- install-macos:
matrix:
alias: test-macos-versions
parameters:
version: [latest, 399.0.0, 410.0.0]
context: orb-publisher
filters: *filters

- auth-oidc:
context:
- gcp-cli-oidc
Expand All @@ -131,6 +150,7 @@ workflows:
- test-executor-versions
- test-google-versions
- test-alpine-versions
- test-macos-versions
- install-components
- auth-oidc
- orb-tools/pack
Expand Down
20 changes: 20 additions & 0 deletions src/executors/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: |
CircleCI's macOS execution environment:
https://circleci.com/docs/configuration-reference/#macos

parameters:
xcode_version:
type: string
default: 14.1.0
description: |
Which macOS execution environment to use. For details, see
https://circleci.com/docs/configuration-reference/#macos
resource-class:
description: Resource class used for the executor.
type: enum
default: medium
enum: [medium, macos.x86.medium.gen2, large, macos.x86.metal.gen1]

macos:
xcode: <<parameters.xcode_version>>
resource_class: << parameters.resource-class >>
16 changes: 15 additions & 1 deletion src/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ install() {
if [ "$major_version" -gt 370 ]; then url_path_fixture="cli"
else url_path_fixture="sdk"; fi

curl --location --silent --fail --retry 3 --output "$install_dir/google-cloud-sdk.tar.gz" "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-$url_path_fixture-$arg_version-linux-x86_64.tar.gz"
os_family="linux"
case $(uname -s | tr '[:upper:]' '[:lower:]') in
linux)
os_family="linux"
;;
darwin)
os_family="darwin"
;;
*)
echo "Unsupported operating system."
exit 1
;;
esac

curl --location --silent --fail --retry 3 --output "$install_dir/google-cloud-sdk.tar.gz" "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-$url_path_fixture-$arg_version-$os_family-x86_64.tar.gz"
tar -xzf "$install_dir/google-cloud-sdk.tar.gz" -C "$install_dir"
printf '%s\n' ". $install_dir/google-cloud-sdk/path.bash.inc" >> "$BASH_ENV"

Expand Down