diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad589ac..206cc86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,14 @@ on: jobs: xcode-build: name: Xcode Build - runs-on: macOS-11 + runs-on: macos-latest strategy: matrix: platform: ['iOS_13'] fail-fast: false steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Bundle Install run: bundle install --gemfile=Example/Gemfile - name: Prepare Simulator Runtimes @@ -26,17 +26,17 @@ jobs: - name: Build and Test run: Scripts/build.swift xcode ${{ matrix.platform }} `which xcpretty` - name: Upload Results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: Test Results path: .build/derivedData/**/Logs/Test/*.xcresult pod-lint: name: Pod Lint - runs-on: macOS-11 + runs-on: macos-latest steps: - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Bundle Install run: bundle install --gemfile=Example/Gemfile - name: Pod Install @@ -47,7 +47,7 @@ jobs: run: bundle exec --gemfile=Example/Gemfile pod lib lint --verbose --fail-fast --include-podspecs=Stagehand.podspec StagehandTesting.podspec spm: name: SPM Build - runs-on: macOS-11 + runs-on: macos-latest strategy: matrix: platform: ['iOS_13'] @@ -61,7 +61,7 @@ jobs: run: Scripts/build.swift spm ${{ matrix.platform }} bazel: name: Bazel - runs-on: macOS-13 + runs-on: macos-latest steps: - name: Checkout Repo uses: actions/checkout@v2 diff --git a/Scripts/build.swift b/Scripts/build.swift index 6d3e767..b116007 100755 --- a/Scripts/build.swift +++ b/Scripts/build.swift @@ -86,16 +86,16 @@ enum Task: String, CustomStringConvertible { } } - var scheme: String { + var scheme: String? { switch self { case .xcode: return "Stagehand Demo App" case .spm: - return "Stagehand-Package" + return nil } } - var shouldGenerateXcodeProject: Bool { + var shouldRunSwiftBuild: Bool { switch self { case .spm: return true @@ -131,8 +131,14 @@ guard let task = Task(rawValue: rawTask) else { throw TaskError.code(1) } -if task.shouldGenerateXcodeProject { - try execute(commandPath: "/usr/bin/swift", arguments: ["package", "generate-xcodeproj", "--output=generated/"]) +if task.shouldRunSwiftBuild { + try execute(commandPath: "/usr/bin/swift", arguments: ["build"]) + Darwin.exit(0) +} + +guard let scheme = task.scheme else { + print("Received unknown scheme for Xcode task \"\(rawTask)\"") + throw TaskError.code(1) } guard let platform = Platform(rawValue: rawPlatform) else { @@ -152,7 +158,7 @@ if let workspace = task.workspace { xcodeBuildArguments.append( contentsOf: [ - "-scheme", task.scheme, + "-scheme", scheme, "-sdk", "iphonesimulator", "-PBXBuildsContinueAfterErrors=0", "-destination", platform.destination,