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

Add Swift 6.0 CI for building carton for macOS #483

Merged
merged 2 commits into from
Jun 10, 2024
Merged
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
14 changes: 13 additions & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
strategy:
matrix:
include:
- os: macos-14
xcode: "15.4"
swift: "6.0"
swift-install:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xcodeを切り替えるだけでは済まないパターンの場合はこの 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"
Expand All @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if で分岐してからスクリプトに入ります。

env:
SWIFT_DIR: ${{ matrix.swift-install.dir }}
SWIFT_VERSION: ${{ matrix.swift-install.version }}

- name: Check Swift version
run: swift --version

Expand Down Expand Up @@ -55,7 +68,6 @@ jobs:
- swift:
dir: "swift-5.9.2-release/ubuntu2204"
version: "swift-5.9.2-RELEASE"

steps:
- name: Checkout the repository
uses: actions/checkout@v4
Expand Down
25 changes: 25 additions & 0 deletions ci/mac/install-swift.bash
Original file line number Diff line number Diff line change
@@ -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