-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (121 loc) · 4.14 KB
/
mobile-release.yml
File metadata and controls
149 lines (121 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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