From 1809295aafaa4ae9f5da01db989016f7e3e04c2e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 29 Jul 2024 15:24:28 +1000 Subject: [PATCH] Use shared vars in Buildkite pipilines and explicitly set `mac` queue --- .buildkite/pipeline.yml | 27 ++++++++++++--------------- .buildkite/release-builds.yml | 17 +++++------------ .buildkite/shared-pipeline-vars | 11 +++++++++++ .xcode-version | 1 + 4 files changed, 29 insertions(+), 27 deletions(-) create mode 100755 .buildkite/shared-pipeline-vars create mode 100644 .xcode-version diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b61b4daec..58fe2ae5a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,29 +1,26 @@ -# Nodes with values to reuse in the pipeline. -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.1.0 - # Common environment values to use with the `env` key. - - &common_env - IMAGE_ID: xcode-15.4 - # This is the default pipeline – it will build and test the app + +env: + IMAGE_ID: $IMAGE_ID + steps: - label: "🔬 Build and Test" command: .buildkite/commands/build-and-test.sh - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac - label: ":swift: SwiftLint" command: run_swiftlint --strict - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] notify: - github_commit_status: context: "SwiftLint" agents: - queue: "default" + queue: default - label: "🛠 Verify App Store Target Builds" command: .buildkite/commands/build-and-test-app-store.sh - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac diff --git a/.buildkite/release-builds.yml b/.buildkite/release-builds.yml index d50740905..606a249c3 100644 --- a/.buildkite/release-builds.yml +++ b/.buildkite/release-builds.yml @@ -1,16 +1,9 @@ -# Nodes with values to reuse in the pipeline. -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.1.0 - # Common environment values to use with the `env` key. - - &common_env - IMAGE_ID: xcode-15.4 - -# This is the default pipeline – it will build and test the app steps: - label: "🛠 App Store Upload" command: .buildkite/commands/build-and-upload-release.sh priority: 1 - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac + env: + IMAGE_ID: $IMAGE_ID diff --git a/.buildkite/shared-pipeline-vars b/.buildkite/shared-pipeline-vars new file mode 100755 index 000000000..41b493b39 --- /dev/null +++ b/.buildkite/shared-pipeline-vars @@ -0,0 +1,11 @@ +#!/bin/sh + +# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used +# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it. + +# The ~> modifier is not currently used, but we check for it just in case +XCODE_VERSION=$(sed -E -n 's/^(~> )?(.*)/xcode-\2/p' .xcode-version) +CI_TOOLKIT_PLUGIN_VERSION="3.4.2" + +export IMAGE_ID="$XCODE_VERSION" +export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION" diff --git a/.xcode-version b/.xcode-version new file mode 100644 index 000000000..232a7fc1a --- /dev/null +++ b/.xcode-version @@ -0,0 +1 @@ +15.4