From 9c5b408e900a67b349e0b45826be14d449ce8984 Mon Sep 17 00:00:00 2001 From: omochimetaru Date: Sun, 9 Jun 2024 22:00:53 +0900 Subject: [PATCH 1/2] add Swift 6 in CI with special hack --- .github/workflows/swift.yml | 30 +++++++++++++++++++++--------- ci/mac/install-swift.bash | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 9 deletions(-) create mode 100755 ci/mac/install-swift.bash diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 695d8981..071b9486 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -14,6 +14,12 @@ jobs: strategy: matrix: include: + - os: macos-14 + xcode: "15.4" + swift: "6.0" + swift-install: + dir: "swift-6.0-branch/xcode" + version: "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-07-a" - os: macos-14 xcode: "15.4" swift: "5.10" @@ -28,6 +34,13 @@ jobs: - name: Select Xcode version run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer + - name: Install Swift ${{ matrix.swift }} + if: ${{ matrix.swift-install != null }} + run: bash ci/mac/install-swift.bash + env: + SWIFT_DIR: ${{ matrix.swift-install.dir }} + SWIFT_VERSION: ${{ matrix.swift-install.version }} + - name: Check Swift version run: swift --version @@ -47,15 +60,14 @@ jobs: timeout-minutes: 40 runs-on: ubuntu-22.04 strategy: - matrix: - include: - - swift: - dir: "swift-5.10-release/ubuntu2204" - version: "swift-5.10-RELEASE" - - swift: - dir: "swift-5.9.2-release/ubuntu2204" - version: "swift-5.9.2-RELEASE" - + matrix: + include: + - swift: + dir: "swift-5.10-release/ubuntu2204" + version: "swift-5.10-RELEASE" + - swift: + dir: "swift-5.9.2-release/ubuntu2204" + version: "swift-5.9.2-RELEASE" steps: - name: Checkout the repository uses: actions/checkout@v4 diff --git a/ci/mac/install-swift.bash b/ci/mac/install-swift.bash new file mode 100755 index 00000000..8d859e1e --- /dev/null +++ b/ci/mac/install-swift.bash @@ -0,0 +1,25 @@ +#!/bin/bash +set -ue +cd "$(dirname "$0")/../.." + +mkdir -p install +cd install + +set -x +pwd +curl -fLO https://download.swift.org/${SWIFT_DIR}/${SWIFT_VERSION}/${SWIFT_VERSION}-osx.pkg +installer -target CurrentUserHomeDirectory -pkg ${SWIFT_VERSION}-osx.pkg + +toolchain=~/Library/Developer/Toolchains/${SWIFT_VERSION}.xctoolchain + +set +x +swift_id=$(plutil -extract CFBundleIdentifier raw ${toolchain}/Info.plist) + +set -x +echo "TOOLCHAINS=${swift_id}" >> $GITHUB_ENV + +# https://github.com/apple/swift/issues/73327#issuecomment-2120481479 +find ${toolchain}/usr/bin -type f | xargs -n 1 -I {} \ + sudo codesign --force --preserve-metadata=identifier,entitlements --sign - {} + +echo "DYLD_LIBRARY_PATH=${toolchain}/usr/lib/swift/macosx" >> $GITHUB_ENV From a75ac46812e929c73cf96bb1b5dc55308f2de6f3 Mon Sep 17 00:00:00 2001 From: omochimetaru Date: Mon, 10 Jun 2024 10:58:57 +0900 Subject: [PATCH 2/2] revert meaningless indent diff --- .github/workflows/swift.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 071b9486..c83a0753 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -60,14 +60,14 @@ jobs: timeout-minutes: 40 runs-on: ubuntu-22.04 strategy: - matrix: - include: - - swift: - dir: "swift-5.10-release/ubuntu2204" - version: "swift-5.10-RELEASE" - - swift: - dir: "swift-5.9.2-release/ubuntu2204" - version: "swift-5.9.2-RELEASE" + matrix: + include: + - swift: + dir: "swift-5.10-release/ubuntu2204" + version: "swift-5.10-RELEASE" + - swift: + dir: "swift-5.9.2-release/ubuntu2204" + version: "swift-5.9.2-RELEASE" steps: - name: Checkout the repository uses: actions/checkout@v4