-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#558] Create Dev scheme and deploy_dev_firebase workflow
- Loading branch information
1 parent
cdef603
commit 7262852
Showing
7 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Deploy Dev Build To Firebase | ||
|
||
# SECRETS needed: | ||
### SSH_PRIVATE_KEY for Match Repo | ||
### MATCH_PASS | ||
### FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run SwiftLint | ||
uses: docker://norionomura/swiftlint:0.53.0_swift-5.7 | ||
with: | ||
args: swiftlint --strict | ||
|
||
build: | ||
name: Build | ||
runs-on: macOS-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Set fetch-depth (default: 1) to get whole tree | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
|
||
- name: Install Firebase-Tools | ||
run: | | ||
yarn global add firebase-tools | ||
echo "$(yarn global bin)" >> $GITHUB_PATH | ||
- name: Setup ENV file | ||
env: | ||
ENV: ${{ secrets.ENV }} | ||
run: | | ||
touch .env | ||
echo $ENV | base64 --decode > .env | ||
- name: Read Google Service Account | ||
id: firebase_service_account | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: 'firebase_service_account.json' | ||
encodedString: ${{ secrets.FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 }} | ||
|
||
- name: Bundle install | ||
# if: steps.bundleCache.outputs.cache-hit != 'true' | ||
run: bundle install | ||
|
||
- name: Run Arkana | ||
run: bundle exec arkana | ||
|
||
- name: Cache Pods | ||
uses: actions/cache@v2 | ||
id: cocoapodCache | ||
with: | ||
path: Pods | ||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-pods- | ||
- name: Install Pods Dependencies | ||
run: bundle exec pod install | ||
shell: bash | ||
|
||
- name: Build and Test | ||
run: bundle exec fastlane buildAndTestDev | ||
|
||
- name: Match Ad-hoc | ||
run: bundle exec fastlane syncAdHocDevCodeSigning | ||
env: | ||
MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} | ||
|
||
- name: Build App and Distribute to Firebase | ||
run: bundle exec fastlane buildDevAndUploadToFirebase | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.firebase_service_account.outputs.filePath }} | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ format('v{0}({1})-{2}', env.VERSION_NUMBER, env.BUILD_NUMBER, env.TAG_TYPE) }} | ||
path: | | ||
${{ env.IPA_OUTPUT_PATH }} | ||
${{ env.DSYM_OUTPUT_PATH }} | ||
env: | ||
TAG_TYPE: Dev_Firebase | ||
|
||
- name: Remove keychain | ||
if: ${{ always() }} | ||
run: bundle exec fastlane removeKeychain | ||
continue-on-error: true |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import Foundation | |
struct SetUpTestFirebase { | ||
|
||
private let teamIdPlaceholder = "<#teamId#>" | ||
private let devFirebaseAppIdPlaceholder = "<#devFirebaseAppId#>" | ||
private let stagingFirebaseAppIdPlaceholder = "<#stagingFirebaseAppId#>" | ||
private let firebaseTesterGroupsPlaceholder = "<#group1#>, <#group2#>" | ||
private let matchRepoPlaceholder = "[email protected]:{organization}/{repo}.git" | ||
|
@@ -11,11 +12,13 @@ struct SetUpTestFirebase { | |
private let fileManager = FileManager.default | ||
|
||
let matchRepo: String | ||
let devFirebaseAppId: String | ||
let stagingFirebaseAppId: String | ||
let teamId: String | ||
|
||
func perform() { | ||
fileManager.replaceAllOccurrences(of: teamIdPlaceholder, to: teamId) | ||
fileManager.replaceAllOccurrences(of: devFirebaseAppIdPlaceholder, to: devFirebaseAppId) | ||
fileManager.replaceAllOccurrences(of: stagingFirebaseAppIdPlaceholder, to: stagingFirebaseAppId) | ||
fileManager.replaceAllOccurrences(of: firebaseTesterGroupsPlaceholder, to: firebaseTesterGroup) | ||
fileManager.replaceAllOccurrences(of: matchRepoPlaceholder, to: matchRepo) | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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