From b10fb134660a095a58a496288da0cbe4a20392fa Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 23 Nov 2022 06:58:00 +0900 Subject: [PATCH 1/2] CI: release: use Xcode 14.1 to enable the macOS 13 SDK Expected to fix issue 1182 Signed-off-by: Akihiro Suda --- .github/workflows/release.yml | 14 +++++++++++++- Makefile | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63d89886410..333c7545460 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,13 @@ name: Release on: push: + branches: + - 'master' tags: - 'v*' - - 'test-action-release-*' + pull_request: + branches: + - 'master' env: GO111MODULE: on jobs: @@ -15,6 +19,13 @@ jobs: runs-on: macos-12 timeout-minutes: 20 steps: + - name: "Switch Xcode version to enable macOS 13 SDK" + # Xcode 14.1 added support for macOS 13 SDK. + # The default version is still 14.0.1, as of November 2022. + # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode + run: | + sudo xcode-select --switch /Applications/Xcode_14.1.app + xcrun --show-sdk-version - uses: actions/setup-go@v3 with: go-version: 1.19.x @@ -81,6 +92,7 @@ jobs: The sha256sum of the SHA256SUMS file itself is \`${shasha}\` . EOF - name: "Create release" + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/Makefile b/Makefile index 0b05144b860..b64f1e9f10e 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,9 @@ endif GO_BUILDTAGS ?= ifeq ($(GOOS),darwin) -MACOS_VERSION=$(shell sw_vers -productVersion | cut -d . -f 1) -ifeq ($(shell test $(MACOS_VERSION) -lt 13; echo $$?),0) -# The "vz" mode needs macOS 13 or later +MACOS_SDK_VERSION=$(shell xcrun --show-sdk-version | cut -d . -f 1) +ifeq ($(shell test $(MACOS_SDK_VERSION) -lt 13; echo $$?),0) +# The "vz" mode needs macOS 13 SDK or later GO_BUILDTAGS += no_vz endif endif From 2f4193ff5d3496c5342d1a7b1038a144f25afe5e Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 23 Nov 2022 07:00:17 +0900 Subject: [PATCH 2/2] CI: deduplicate tasks Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf8b72fb98e..8a2cd78f773 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,8 +83,6 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 1 - - name: Test making darwin artifacts - run: make artifacts-darwin - name: Unit tests run: go test -v ./... - name: Make @@ -243,23 +241,3 @@ jobs: retry_on: error max_attempts: 3 command: ./hack/test-upgrade.sh ${{ matrix.oldver }} ${{ github.sha }} - - artifacts-linux: - name: Artifacts Linux - runs-on: ubuntu-22.04 - timeout-minutes: 20 - steps: - - uses: actions/setup-go@v3 - with: - go-version: 1.19.x - - name: Install gcc-aarch64-linux-gnu - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - name: Make linux artifacts - run: make artifacts-linux - - name: Make misc artifacts - run: make artifacts-misc