Skip to content

Commit 3b5bc24

Browse files
authored
Fix xcframework target naming issues with Swift versions before 5.8 (#29)
* Extend GH action to test on with Swift 5.7 * Test on macOS 12 + Xcode 13.4.1 * Test on macOS 12 + Xcode 13.4.1
1 parent 904737a commit 3b5bc24

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

.github/workflows/ci-macos.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: macos-13
1313
strategy:
1414
matrix:
15-
xcode: ["14.3.1"]
15+
xcode: ["14.1", "15.0"]
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v3.5.3
@@ -65,3 +65,48 @@ jobs:
6565
path: |
6666
SDL2.xcframework.zip
6767
SDL2.xcframework.checksum.txt
68+
69+
macos-test-build-release-xcode-legacy:
70+
runs-on: macos-12
71+
strategy:
72+
matrix:
73+
xcode: ["13.4.1"]
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v3.5.3
77+
78+
- name: Select Xcode ${{ matrix.xcode }}
79+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
80+
81+
- name: Test
82+
run: swift test
83+
env:
84+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
85+
86+
- name: Upload test artifacts
87+
if: failure()
88+
uses: actions/upload-artifact@v3.1.2
89+
with:
90+
name: test-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
91+
path: |
92+
.build/**/*.json
93+
.build/**/*.xctest
94+
95+
- name: Build Release
96+
run: swift build -c release
97+
env:
98+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
99+
100+
- name: Upload build artifacts
101+
if: failure()
102+
uses: actions/upload-artifact@v3.1.2
103+
with:
104+
name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
105+
path: |
106+
*.lcov
107+
.build/*.yaml
108+
.build/**/*.a
109+
.build/**/*.so
110+
.build/**/*.dylib
111+
.build/**/*.dSYM
112+
.build/**/*.json

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ let package = Package(
1515
targets: [
1616
.target(name: "SDL",
1717
dependencies: [
18-
.target(name: "SDL2-apple", condition: .when(platforms: [.macOS, .iOS, .tvOS])),
18+
.target(name: "SDL2", condition: .when(platforms: [.macOS, .iOS, .tvOS])),
1919
.target(name: "CSDL2", condition: .when(platforms: [.linux, .windows])),
2020
],
2121
path: "Sources/SDL2"),
2222
.testTarget(name: "SDLTests", dependencies: ["SDL"]),
23-
.binaryTarget(name: "SDL2-apple", path: "SDL2.xcframework"),
23+
.binaryTarget(name: "SDL2", path: "SDL2.xcframework"),
2424
.systemLibrary(
2525
name: "CSDL2",
2626
pkgConfig: "sdl2",

0 commit comments

Comments
 (0)