Some more pipeline-fixes #46
| @@ -40,14 +40,15 @@ jobs: | |||||||
|           MATCH_REPO_SSH_KEY: ${{ secrets.IOS_MATCH_REPO_SSH_KEY_BASE64 }} |           MATCH_REPO_SSH_KEY: ${{ secrets.IOS_MATCH_REPO_SSH_KEY_BASE64 }} | ||||||
|  |  | ||||||
|       - name: Install fastlane |       - name: Install fastlane | ||||||
|         run: bundle install && bundle update |         run: bundle install | ||||||
|         working-directory: ios |         working-directory: ios | ||||||
|  |  | ||||||
|       - name: Install dependencies |       - name: Install dependencies and clean up | ||||||
|         run: | |         run: | | ||||||
|           flutter pub get |           flutter pub get | ||||||
|           bundle exec pod install |           bundle exec pod install | ||||||
|           bundle exec pod update |           flutter clean | ||||||
|  |           bundle exec pod cache clean --all | ||||||
|         working-directory: ios |         working-directory: ios | ||||||
|  |  | ||||||
|       - name: Run fastlane lane |       - name: Run fastlane lane | ||||||
| @@ -61,3 +62,4 @@ jobs: | |||||||
|           IOS_ASC_ISSUER_ID: ${{ secrets.IOS_ASC_ISSUER_ID }} |           IOS_ASC_ISSUER_ID: ${{ secrets.IOS_ASC_ISSUER_ID }} | ||||||
|           IOS_ASC_KEY: ${{ secrets.IOS_ASC_KEY }} |           IOS_ASC_KEY: ${{ secrets.IOS_ASC_KEY }} | ||||||
|           MATCH_PASSWORD: ${{ secrets.IOS_MATCH_PASSWORD }} |           MATCH_PASSWORD: ${{ secrets.IOS_MATCH_PASSWORD }} | ||||||
|  |           IOS_GOOGLE_MAPS_API_KEY: ${{ secrets.IOS_GOOGLE_MAPS_API_KEY }} | ||||||
|   | |||||||
| @@ -50,13 +50,12 @@ Secrets used by fastlane are stored on hashicorp vault and are fetched by the CI | |||||||
|  |  | ||||||
| ## Secrets | ## Secrets | ||||||
| These are mostly used by the CI/CD pipeline to deploy the application. The main usage for github actions is documented under [https://github.com/hashicorp/vault-action](https://github.com/hashicorp/vault-action). | These are mostly used by the CI/CD pipeline to deploy the application. The main usage for github actions is documented under [https://github.com/hashicorp/vault-action](https://github.com/hashicorp/vault-action). | ||||||
| **Global secrets** are used for both versions of the app (android and ios).  |  | ||||||
| - `GOOGLE_MAPS_API_KEY` is used to authenticate with the Google Maps API |  | ||||||
|  |  | ||||||
| **Platform-specific secrets** are used by the CI/CD pipeline to deploy to the respective app stores. | **Platform-specific secrets** are used by the CI/CD pipeline to deploy to the respective app stores. | ||||||
|  | - `GOOGLE_MAPS_API_KEY` is used to authenticate with the Google Maps API and is scoped to the android platform | ||||||
| - `ANDROID_KEYSTORE` is used to sign the android apk | - `ANDROID_KEYSTORE` is used to sign the android apk | ||||||
| - `ANDROID_GOOGLE_KEY` is used to authenticate with the Google Play Store api | - `ANDROID_GOOGLE_KEY` is used to authenticate with the Google Play Store api | ||||||
| - `IOS_GOOGLE_...` | - `IOS_GOOGLE_MAPS_API_KEY` is used to authenticate with the Google Maps API and is scoped to the ios platform | ||||||
| - `IOS_GOOGLE_...` | - `IOS_GOOGLE_...` | ||||||
| - `IOS_GOOGLE_...` | - `IOS_GOOGLE_...` | ||||||
| - `IOS_GOOGLE_...` | - `IOS_GOOGLE_...` | ||||||
| @@ -9,8 +9,7 @@ import GoogleMaps | |||||||
|     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? |     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? | ||||||
|   ) -> Bool { |   ) -> Bool { | ||||||
|     // load the key from env |     // load the key from env | ||||||
|     let key = ProcessInfo.processInfo.environment["GOOGLE_MAPS_API_KEY"]! |     GMSServices.provideAPIKey("IOS_GOOGLE_MAPS_API_KEY") | ||||||
|     GMSServices.provideAPIKey(key) |  | ||||||
|     GeneratedPluginRegistrant.register(with: self) |     GeneratedPluginRegistrant.register(with: self) | ||||||
|     return super.application(application, didFinishLaunchingWithOptions: launchOptions) |     return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -10,4 +10,4 @@ IOS_ASC_ISSUER_ID="sample" | |||||||
| SIGNING_KEY_FILE_PATH="sample" | SIGNING_KEY_FILE_PATH="sample" | ||||||
| SIGNING_KEY_PASSWORD="sample" | SIGNING_KEY_PASSWORD="sample" | ||||||
|  |  | ||||||
| GOOGLE_MAPS_API_KEY="sample" | IOS_GOOGLE_MAPS_API_KEY="sample" | ||||||
|   | |||||||
| @@ -33,7 +33,7 @@ platform :ios do | |||||||
|       "flutter", |       "flutter", | ||||||
|       "build", |       "build", | ||||||
|       "ipa", |       "ipa", | ||||||
|       "--release", |       "--debug", | ||||||
|       "--build-name=#{build_name}", |       "--build-name=#{build_name}", | ||||||
|       "--build-number=#{build_number}", |       "--build-number=#{build_number}", | ||||||
|     ) |     ) | ||||||
| @@ -64,6 +64,16 @@ platform :ios do | |||||||
|       readonly: true, |       readonly: true, | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|  |     # replace secrets by real values, the stupid way | ||||||
|  |     sh( | ||||||
|  |       "sed", | ||||||
|  |       "-i", | ||||||
|  |       "", | ||||||
|  |       "s/IOS_GOOGLE_MAPS_API_KEY/#{ENV["IOS_GOOGLE_MAPS_API_KEY"]}/g", | ||||||
|  |       "ios/Runner/AppDelegate.swift" | ||||||
|  |  | ||||||
|  |     ) | ||||||
|  |  | ||||||
|     sh( |     sh( | ||||||
|       "flutter", |       "flutter", | ||||||
|       "build", |       "build", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user