-
Notifications
You must be signed in to change notification settings - Fork 21
Use fastlane to build and distribute iOS app #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
432a05a
61d3959
34fd281
72771ec
9e00a15
0c6b02c
0c0d6de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| ## NOTE(louis): This Gemfile is intended for the whole project, except ./example/reactnative | ||
|
|
||
| source 'https://rubygems.org' | ||
| source "https://rubygems.org" | ||
|
|
||
| # Ruby 3.3 is the default. | ||
| # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md | ||
| # https://github.com/actions/runner-images/issues/11345 | ||
| ruby "~> 3.3" | ||
|
|
||
| gem 'cocoapods', '~> 1.16' | ||
| gem "cocoapods", "~> 1.16" | ||
| gem "fastlane", "~> 2.227" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,3 +65,105 @@ build-image: | |
| .PHONY: push-image | ||
| push-image: | ||
| docker push $(IMAGE) | ||
|
|
||
| .PHONY: clean | ||
| clean: | ||
| rm -rf ./build | ||
|
|
||
| .PHONY: sdk-build | ||
| sdk-build: | ||
| npm ci | ||
| npm run build | ||
|
|
||
| .PHONY: react-native-npm-ci | ||
| react-native-npm-ci: | ||
| cd ./example/reactnative; \ | ||
| rm -rf node_modules; \ | ||
| yarn install --frozen-lockfile | ||
|
|
||
| .PHONY: react-native-set-versionCode | ||
| react-native-set-versionCode: | ||
| /usr/bin/sed -I "" "s/versionCode 1/versionCode $(shell date +%s)/" ./example/reactnative/android/app/build.gradle | ||
|
|
||
| .PHONY: react-native-build-unsigned-apk | ||
| react-native-build-unsigned-apk: | ||
| cd ./example/reactnative/android; \ | ||
| ./gradlew :app:assembleRelease | ||
|
|
||
| .PHONY: react-native-zipalign | ||
| react-native-zipalign: | ||
| "$(ANDROID_HOME)/build-tools/33.0.3/zipalign" -c -v 4 ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk | ||
|
|
||
| .PHONY: react-native-apksigner | ||
| react-native-apksigner: | ||
| "$(ANDROID_HOME)/build-tools/33.0.3/apksigner" sign \ | ||
| --ks $(ANDROID_KEYSTORE_PATH) \ | ||
| --ks-key-alias $(ANDROID_KEY_ALIAS) \ | ||
| --ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) \ | ||
| --key-pass pass:$(ANDROID_KEY_PASSWORD) \ | ||
| --out ./example/reactnative/android/app/build/outputs/apk/release/app-release-signed.apk \ | ||
| ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk | ||
|
Comment on lines
+88
to
+105
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just moved the code from the YAML file to here. Will use fastlane to distribute in another PR. |
||
|
|
||
| .PHONY: react-native-pod-install | ||
| react-native-pod-install: | ||
| cd ./example/reactnative/ios; bundle exec pod install | ||
|
|
||
| .PHONY: react-native-build-ios-app | ||
| react-native-build-ios-app: | ||
| bundle exec fastlane react_native_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +%s) | ||
|
|
||
| .PHONY: react-native-upload-ios-app | ||
| react-native-upload-ios-app: | ||
| bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/reactNativeExample/reactNativeExample.ipa | ||
|
|
||
| .PHONY: capacitor-npm-ci | ||
| capacitor-npm-ci: | ||
| cd ./example/capacitor; \ | ||
| npm ci | ||
|
|
||
| .PHONY: capacitor-npm-audit | ||
| capacitor-npm-audit: | ||
| cd ./example/capacitor; \ | ||
| npm audit | ||
|
|
||
| # npx cap sync runs `bundle exec pod install` under the hood. | ||
| .PHONY: capacitor-build-js | ||
| capacitor-build-js: | ||
| cd ./example/capacitor; \ | ||
| npm run build; \ | ||
| npx cap sync | ||
|
|
||
| .PHONY: capacitor-build-ios-simulator | ||
| capacitor-build-ios-simulator: | ||
| bundle exec fastlane capacitor_build_ios_simulator | ||
|
|
||
| .PHONY: capacitor-build-ios-app | ||
| capacitor-build-ios-app: | ||
| bundle exec fastlane capacitor_build_ios_app CURRENT_PROJECT_VERSION:$(shell date +%s) | ||
|
|
||
| .PHONY: capacitor-upload-ios-app | ||
| capacitor-upload-ios-app: | ||
| bundle exec fastlane upload_ios_app ipa:./build/Release/iOS/capacitor/capacitor.ipa | ||
|
|
||
| .PHONY: capacitor-build-unsigned-apk | ||
| capacitor-build-unsigned-apk: | ||
| cd ./example/capacitor/android; \ | ||
| ./gradlew :app:assembleRelease | ||
|
|
||
| .PHONY: capacitor-set-versionCode | ||
| capacitor-set-versionCode: | ||
| /usr/bin/sed -I "" "s/versionCode 1/versionCode $(shell date +%s)/" ./example/capacitor/android/app/build.gradle | ||
|
|
||
| .PHONY: capacitor-zipalign | ||
| capacitor-zipalign: | ||
| "$(ANDROID_HOME)/build-tools/35.0.1/zipalign" -c -v 4 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk | ||
|
|
||
| .PHONY: capacitor-apksigner | ||
| capacitor-apksigner: | ||
| "$(ANDROID_HOME)/build-tools/35.0.1/apksigner" sign \ | ||
| --ks $(ANDROID_KEYSTORE_PATH) \ | ||
| --ks-key-alias $(ANDROID_KEY_ALIAS) \ | ||
| --ks-pass pass:$(ANDROID_KEYSTORE_PASSWORD) \ | ||
| --key-pass pass:$(ANDROID_KEY_PASSWORD) \ | ||
| --out ./example/capacitor/android/app/build/outputs/apk/release/app-release-signed.apk \ | ||
| ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? Seems not referenced anywhere.And I believe there should be other way to set the version code without using text replacementFound it was referenced in the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can either:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will improve this when I do the android part.