Build Mobile Apps #11
Workflow file for this run
This file contains hidden or 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 Mobile Apps | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Release version (e.g. v1.1.0)" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-android: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend-mobile | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| cache-dependency-path: frontend-mobile/pnpm-lock.yaml | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Prebuild Android Project | |
| run: npx expo prebuild --platform android --clean | |
| - name: Disable PNG Crunching | |
| run: echo "android.enablePngCrunchInReleaseBuilds=false" >> android/gradle.properties | |
| - name: Build Release APK | |
| run: cd android && ./gradlew assembleRelease | |
| - name: Build Android Test APK | |
| run: cd android && ./gradlew assembleAndroidTest | |
| - name: Rename APKs | |
| run: | | |
| mv android/app/build/outputs/apk/release/app-release.apk android/app/build/outputs/apk/release/omnipizza-release.apk | |
| mv android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk android/app/build/outputs/apk/androidTest/debug/omnipizza-debug-androidTest.apk | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OmniPizza-Android | |
| path: | | |
| frontend-mobile/android/app/build/outputs/apk/release/omnipizza-release.apk | |
| frontend-mobile/android/app/build/outputs/apk/androidTest/debug/omnipizza-debug-androidTest.apk | |
| build-ios: | |
| name: Build iOS Simulator App | |
| runs-on: macos-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend-mobile | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| cache-dependency-path: frontend-mobile/pnpm-lock.yaml | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Prebuild iOS Project | |
| run: npx expo prebuild --platform ios --clean | |
| - name: Install CocoaPods | |
| run: cd ios && pod install | |
| - name: Build for Simulator | |
| run: | | |
| cd ios | |
| xcodebuild -workspace OmniPizza.xcworkspace \ | |
| -scheme OmniPizza \ | |
| -configuration Release \ | |
| -sdk iphonesimulator \ | |
| -derivedDataPath build | |
| - name: Zip .app Bundle | |
| run: | | |
| cd ios/build/Build/Products/Release-iphonesimulator | |
| zip -r OmniPizza-Simulator.zip OmniPizza.app | |
| - name: Upload iOS Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OmniPizza-iOS-Simulator | |
| path: frontend-mobile/ios/build/Build/Products/Release-iphonesimulator/OmniPizza-Simulator.zip | |
| release: | |
| name: Create GitHub Release | |
| needs: [build-android, build-ios] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Android Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: OmniPizza-Android | |
| path: artifacts/android | |
| - name: Download iOS Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: OmniPizza-iOS-Simulator | |
| path: artifacts/ios | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.event.inputs.version }} | |
| name: OmniPizza ${{ github.event.inputs.version }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/android/**/*.apk | |
| artifacts/ios/OmniPizza-Simulator.zip |