build-demo-app-from-main #21
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
name: build-demo-app-from-main | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 0-4" # At 00:00 on every day-of-week from Sunday through Thursday | |
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/[email protected] | |
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: 1 | |
- name: Upload demo app file | |
uses: actions/upload-artifact@v4 | |
id: artifact-upload-step | |
if: ${{ success() }} | |
with: | |
name: SparkMainDemo.app | |
path: | | |
${{ env.xcodebuild_derivedData }}Build/Products/Debug-iphonesimulator/${{ env.app_name }}.app | |
retention-days: 7 |