From f79559dd6077b414d16ceb98a884d529e30661b2 Mon Sep 17 00:00:00 2001 From: Robin Lemaire Date: Fri, 13 Sep 2024 15:31:42 +0200 Subject: [PATCH 1/2] Fix .app name --- .github/workflows/buildDemo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildDemo.yml b/.github/workflows/buildDemo.yml index d7498dbc9..f57bbf625 100644 --- a/.github/workflows/buildDemo.yml +++ b/.github/workflows/buildDemo.yml @@ -53,5 +53,5 @@ jobs: with: name: SparkMainDemo.app path: | - spark-ios/${{ env.xcodebuild_derivedData }}Build/Products/Debug-iphonesimulator/SparkMainDemo.app + spark-ios/${{ env.xcodebuild_derivedData }}Build/Products/Debug-iphonesimulator/${{ env.app_name }}.app retention-days: 15 From b60b10f13d75c19418d99b78b924c25eb01c4a90 Mon Sep 17 00:00:00 2001 From: Robin Lemaire Date: Fri, 13 Sep 2024 15:37:34 +0200 Subject: [PATCH 2/2] Fix bad yml --- .github/workflows/buildDemo.yml | 38 +++--------------- .github/workflows/generateDemoApp.yml | 57 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/generateDemoApp.yml diff --git a/.github/workflows/buildDemo.yml b/.github/workflows/buildDemo.yml index f57bbf625..400d785fc 100644 --- a/.github/workflows/buildDemo.yml +++ b/.github/workflows/buildDemo.yml @@ -1,43 +1,27 @@ -name: build-demo-app-from-main - -on: workflow_dispatch +name: build-demo +on: workflow_call env: app_name: SparkDemo - swift_version: "5.9" xcode_path: "/Applications/Xcode_15.4.app" - xcodebuild_sdk: -sdk iphonesimulator - xcodebuild_derivedData: ".derivedData/" - xcodebuild_destination: -destination 'platform=iOS Simulator,name=iPhone 15 pro,OS=17.5' jobs: - build-demo-app: - name: Build the demo app from the main branch + build: + name: Build runs-on: macos-14 steps: - - name: Set Swift Version - uses: swift-actions/setup-swift@v1 - with: - swift-version: ${{ env.swift_version }} - - - name: Get swift version - run: swift --version - - name: Select Xcode run: sudo xcode-select -s ${{ env.xcode_path }} - - name: Checkout Action uses: actions/checkout@v4 - - name: Run xcodegen uses: xavierLowmiller/xcodegen-action@1.2.2 with: + spec: project.yml version: "2.41.0" - - name: Build run: | - xcodebuild -scheme ${{ env.app_name }} -derivedDataPath ${{ env.xcodebuild_derivedData }} ${{ env.xcodebuild_sdk }} ${{ env.xcodebuild_destination }} -resultBundlePath ${{ env.app_name }}.xcresult build - + xcodebuild -scheme ${{ env.app_name }} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15 pro,OS=17.5' build - name: Upload xcresult file uses: actions/upload-artifact@v4 if: ${{ failure() }} @@ -45,13 +29,3 @@ jobs: name: ${{ env.app_name }}-${{ github.run_number }}.xcresult path: ${{ env.app_name }}.xcresult retention-days: 15 - - - name: Upload demo app file - uses: actions/upload-artifact@v4 - id: artifact-upload-step - if: ${{ success() }} - with: - name: SparkMainDemo.app - path: | - spark-ios/${{ env.xcodebuild_derivedData }}Build/Products/Debug-iphonesimulator/${{ env.app_name }}.app - retention-days: 15 diff --git a/.github/workflows/generateDemoApp.yml b/.github/workflows/generateDemoApp.yml new file mode 100644 index 000000000..fefabd09d --- /dev/null +++ b/.github/workflows/generateDemoApp.yml @@ -0,0 +1,57 @@ +name: build-demo-app-from-main + +on: workflow_dispatch + +env: + app_name: SparkDemo + swift_version: "5.9" + xcode_path: "/Applications/Xcode_15.4.app" + xcodebuild_sdk: -sdk iphonesimulator + xcodebuild_derivedData: ".derivedData/" + xcodebuild_destination: -destination 'platform=iOS Simulator,name=iPhone 15 pro,OS=17.5' + +jobs: + build-demo-app: + name: Generate the SparkDemo.app from the main branch + runs-on: macos-14 + steps: + - name: Set Swift Version + uses: swift-actions/setup-swift@v1 + with: + swift-version: ${{ env.swift_version }} + + - name: Get swift version + run: swift --version + + - name: Select Xcode + run: sudo xcode-select -s ${{ env.xcode_path }} + + - name: Checkout Action + uses: actions/checkout@v4 + + - name: Run xcodegen + uses: xavierLowmiller/xcodegen-action@1.2.2 + with: + version: "2.41.0" + + - name: Build + run: | + xcodebuild -scheme ${{ env.app_name }} -derivedDataPath ${{ env.xcodebuild_derivedData }} ${{ env.xcodebuild_sdk }} ${{ env.xcodebuild_destination }} -resultBundlePath ${{ env.app_name }}.xcresult build + + - name: Upload xcresult file + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: ${{ env.app_name }}-${{ github.run_number }}.xcresult + path: ${{ env.app_name }}.xcresult + retention-days: 15 + + - name: Upload demo app file + uses: actions/upload-artifact@v4 + id: artifact-upload-step + if: ${{ success() }} + with: + name: SparkMainDemo.app + path: | + spark-ios/${{ env.xcodebuild_derivedData }}Build/Products/Debug-iphonesimulator/${{ env.app_name }}.app + retention-days: 15