-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1094 from adevinta/gha/buildDemo
[GHA] Fix .app name
- Loading branch information
Showing
2 changed files
with
63 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |