diff --git a/.buildkite/commands/checkout-release-branch.sh b/.buildkite/commands/checkout-release-branch.sh deleted file mode 100755 index 0650af0d1d41..000000000000 --- a/.buildkite/commands/checkout-release-branch.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -eu - -# Checks out the `release/*` branch for a given release version. -# -# Usage: checkout-release-branch.sh [] -# -# The release version is taken from the first of these that is set and non-empty: -# 1. the first argument -# 2. the `RELEASE_VERSION` environment variable -# 3. the `release/*` branch the build is running on, via `BUILDKITE_BRANCH` -# -# Buildkite, by default, checks out a specific commit, ending up in a detached HEAD state. -# But some release steps need to be on the `release/*` branch instead, namely: -# - when a `release-pipelines/*.yml` needs to `git push` to the `release/*` branch (for version bumps) -# - when a job `pipeline upload`'d by such a pipeline builds from that branch, so that the build -# includes the commit that the version bump just added. - -echo "--- :git: Checkout Release Branch" - -RELEASE_VERSION="${1:-${RELEASE_VERSION:-}}" - -if [[ -z "$RELEASE_VERSION" && "${BUILDKITE_BRANCH:-}" =~ ^release/ ]]; then - RELEASE_VERSION="${BUILDKITE_BRANCH#release/}" -fi - -if [[ -z "$RELEASE_VERSION" ]]; then - echo "Error: no release version. Pass it as \$1, set RELEASE_VERSION, or run on a release/* branch." >&2 - exit 1 -fi - -BRANCH_NAME="release/${RELEASE_VERSION}" -git fetch origin "$BRANCH_NAME" -git checkout "$BRANCH_NAME" -# Buildkite can reuse a working copy where "$BRANCH_NAME" was left at a different commit by a previous job, -# so force the local branch to the fetched commit. -# - `reset --hard` rather than `git pull`, to avoid merging if the two diverged -# - `FETCH_HEAD` rather than `origin/$BRANCH_NAME`, which `git fetch ` only updates opportunistically. -git reset --hard FETCH_HEAD diff --git a/.buildkite/commands/complete-code-freeze.sh b/.buildkite/commands/complete-code-freeze.sh index 9297d9e4d298..5f3654e43274 100755 --- a/.buildkite/commands/complete-code-freeze.sh +++ b/.buildkite/commands/complete-code-freeze.sh @@ -10,7 +10,7 @@ fi echo '--- :robot_face: Use bot for Git operations' source use-bot-for-git -.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER" +checkout_release_branch "$RELEASE_NUMBER" "$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh" diff --git a/.buildkite/commands/finalize-hotfix.sh b/.buildkite/commands/finalize-hotfix.sh index cb3be53d1d66..e69f6e6a137a 100755 --- a/.buildkite/commands/finalize-hotfix.sh +++ b/.buildkite/commands/finalize-hotfix.sh @@ -10,7 +10,7 @@ fi echo '--- :robot_face: Use bot for Git operations' source use-bot-for-git -.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER" +checkout_release_branch "$RELEASE_NUMBER" echo '--- :ruby: Setup Ruby tools' install_gems diff --git a/.buildkite/commands/finalize-release.sh b/.buildkite/commands/finalize-release.sh index bbba37e01b8d..921e50761041 100755 --- a/.buildkite/commands/finalize-release.sh +++ b/.buildkite/commands/finalize-release.sh @@ -10,7 +10,7 @@ fi echo '--- :robot_face: Use bot for Git operations' source use-bot-for-git -.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER" +checkout_release_branch "$RELEASE_NUMBER" echo '--- :ruby: Setup Ruby tools' install_gems diff --git a/.buildkite/release-builds.yml b/.buildkite/release-builds.yml index 1839174c967f..99338e8aab87 100644 --- a/.buildkite/release-builds.yml +++ b/.buildkite/release-builds.yml @@ -9,7 +9,7 @@ steps: - label: ":wordpress: :testflight: WordPress Release Build (App Store Connect)" command: | - .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + checkout_release_branch "$RELEASE_VERSION" .buildkite/commands/release-build-wordpress.sh $IS_BETA_RELEASE plugins: [$CI_TOOLKIT_PLUGIN] notify: @@ -21,7 +21,7 @@ steps: - label: ":jetpack: :testflight: Jetpack Release Build (App Store Connect)" command: | - .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + checkout_release_branch "$RELEASE_VERSION" .buildkite/commands/release-build-jetpack.sh plugins: [$CI_TOOLKIT_PLUGIN] notify: diff --git a/.buildkite/release-pipelines/publish-release.yml b/.buildkite/release-pipelines/publish-release.yml index 024c3f616f90..71e92ce303e5 100644 --- a/.buildkite/release-pipelines/publish-release.yml +++ b/.buildkite/release-pipelines/publish-release.yml @@ -14,7 +14,7 @@ steps: echo '--- :robot_face: Use bot for Git operations' source use-bot-for-git - .buildkite/commands/checkout-release-branch.sh "$RELEASE_VERSION" + checkout_release_branch "$RELEASE_VERSION" echo '--- :ruby: Setup Ruby tools' install_gems diff --git a/.buildkite/shared-pipeline-vars b/.buildkite/shared-pipeline-vars index ef632b72f9df..a582ccd52c0a 100755 --- a/.buildkite/shared-pipeline-vars +++ b/.buildkite/shared-pipeline-vars @@ -5,7 +5,7 @@ # The ~> modifier is not currently used, but we check for it just in case XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version) -CI_TOOLKIT_PLUGIN_VERSION="6.1.1" +CI_TOOLKIT_PLUGIN_VERSION="6.3.0" TEST_COLLECTOR_PLUGIN_VERSION="1.11.0" export IMAGE_ID="xcode-$XCODE_VERSION"