Skip to content

Commit

Permalink
Merge pull request #1094 from adevinta/gha/buildDemo
Browse files Browse the repository at this point in the history
[GHA] Fix .app name
  • Loading branch information
robergro authored Sep 13, 2024
2 parents f057509 + 6db7ce9 commit cbc11b4
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 32 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/buildDemo.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,31 @@
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() }}
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/SparkMainDemo.app
retention-days: 15
57 changes: 57 additions & 0 deletions .github/workflows/generateDemoApp.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cbc11b4

Please sign in to comment.