@@ -2,14 +2,9 @@ REF := $(shell git describe --all --exact-match | sed -e "s|^heads/||")
22GIT_HASH ?= git-$(shell git rev-parse --short=12 HEAD)
33IMAGE ?= quay.io/theauthgear/authgear-demo-webapp:$(GIT_HASH )
44
5- API_ISSUER ?= invalid
6- API_KEY ?= invalid
7-
8- REACT_NATIVE_ARCHIVE_PATH ?= ./build/Release/iOS/reactNativeExample.xcarchive
9- REACT_NATIVE_EXPORT_PATH ?= ./build/Release/iOS/reactNativeExample.export
10-
11- CAPACITOR_ARCHIVE_PATH ?= ./build/Release/iOS/App/App.xcarchive
12- CAPACITOR_EXPORT_PATH ?= ./build/Release/iOS/App/App.export
5+ API_ISSUER ?= "invalid"
6+ API_KEY ?= "invalid"
7+ API_KEY_PATH ?= ./AuthKey_invalid.p8
138
149# The documentation build pipeline works in the following way.
1510#
@@ -77,8 +72,16 @@ push-image:
7772
7873.PHONY : clean
7974clean :
80- rm -rf ./example/reactnative/ios/build
81- rm -rf ./example/capacitor/ios/App/App/build
75+ rm -rf ./build
76+
77+ .PHONY : fastlane-api-key-json
78+ fastlane-api-key-json :
79+ mkdir -p ./build
80+ jq --slurp --raw-input > ./build/fastlane-api-key.json \
81+ --arg key_id $(API_KEY ) \
82+ --arg issuer_id $(API_ISSUER ) \
83+ ' {key_id: $$key_id, issuer_id: $$issuer_id, key: .}' \
84+ $(API_KEY_PATH )
8285
8386.PHONY : sdk-build
8487sdk-build :
@@ -122,27 +125,13 @@ react-native-bundle-install:
122125react-native-pod-install :
123126 cd ./example/reactnative/ios; bundle exec pod install
124127
125- .PHONY : react-native-set-CFBundleVersion
126- react-native-set-CFBundleVersion :
127- /usr/libexec/Plistbuddy -c " Set CFBundleVersion $( shell date +%s) " ./example/reactnative/ios/reactNativeExample/Info.plist
128-
129- .PHONY : react-native-archive
130- react-native-archive :
131- cd ./example/reactnative/ios; \
132- xcodebuild archive \
133- -destination " generic/platform=iOS" \
134- -workspace reactNativeExample.xcworkspace \
135- -scheme reactNativeExample \
136- -configuration Release \
137- -archivePath $(REACT_NATIVE_ARCHIVE_PATH )
138-
139- .PHONY : react-native-export-archive
140- react-native-export-archive :
141- cd ./example/reactnative/ios; \
142- xcodebuild -exportArchive \
143- -archivePath $(REACT_NATIVE_ARCHIVE_PATH ) \
144- -exportPath $(REACT_NATIVE_EXPORT_PATH ) \
145- -exportOptionsPlist ./ExportOptions.plist
128+ .PHONY : react-native-build-ios-app
129+ react-native-build-ios-app :
130+ bundle exec fastlane react_native_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +% s)
131+
132+ .PHONY : react-native-upload-ios-app
133+ react-native-upload-ios-app :
134+ bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/reactNativeExample/reactNativeExample.ipa
146135
147136.PHONY : capacitor-npm-ci
148137capacitor-npm-ci :
@@ -163,33 +152,15 @@ capacitor-build-js:
163152
164153.PHONY : capacitor-build-ios-simulator
165154capacitor-build-ios-simulator :
166- cd ./example/capacitor/ios/App; \
167- xcodebuild build \
168- -destination " generic/platform=iOS Simulator" \
169- -workspace App.xcworkspace \
170- -scheme App
171-
172- .PHONY : capacitor-set-CFBundleVersion
173- capacitor-set-CFBundleVersion :
174- /usr/libexec/Plistbuddy -c " Set CFBundleVersion $( shell date +%s) " ./example/capacitor/ios/App/App/Info.plist
175-
176- .PHONY : capacitor-archive
177- capacitor-archive :
178- cd ./example/capacitor/ios/App; \
179- xcodebuild archive \
180- -destination " generic/platform=iOS" \
181- -workspace App.xcworkspace \
182- -scheme App \
183- -configuration Release \
184- -archivePath $(CAPACITOR_ARCHIVE_PATH )
185-
186- .PHONY : capacitor-exportArchive
187- capacitor-exportArchive :
188- cd ./example/capacitor/ios/App; \
189- xcodebuild -exportArchive \
190- -archivePath $(CAPACITOR_ARCHIVE_PATH ) \
191- -exportPath $(CAPACITOR_EXPORT_PATH ) \
192- -exportOptionsPlist ./ExportOptions.plist
155+ bundle exec fastlane capacitor_build_ios_simulator
156+
157+ .PHONY : capacitor-build-ios-app
158+ capacitor-build-ios-app :
159+ bundle exec fastlane capacitor_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +% s)
160+
161+ .PHONY : capacitor-upload-ios-app
162+ capacitor-upload-ios-app :
163+ bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/capacitor/capacitor.ipa
193164
194165.PHONY : capacitor-build-unsigned-apk
195166capacitor-build-unsigned-apk :
@@ -213,19 +184,3 @@ capacitor-apksigner:
213184 --key-pass pass:$(ANDROID_KEY_PASSWORD ) \
214185 --out ./example/capacitor/android/app/build/outputs/apk/release/app-release-signed.apk \
215186 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
216-
217- .PHONY : validate-app
218- validate-app :
219- xcrun altool --validate-app \
220- --file $(IPA_PATH ) \
221- --type ios \
222- --apiKey $(API_KEY ) \
223- --apiIssuer $(API_ISSUER )
224-
225- .PHONY : upload-app
226- upload-app :
227- xcrun altool --upload-app \
228- --file $(IPA_PATH ) \
229- --type ios \
230- --apiKey $(API_KEY ) \
231- --apiIssuer $(API_ISSUER )
0 commit comments