Skip to content
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

feat(.github/workflows): Firebase CI/CD #3238

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-apks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
bubble_iframe_url: NUMBERS_BUBBLE_IFRAME_URL
bubble_db_url: NUMBERS_BUBBLE_DB_QA_URL # FIXME: rename to networ_action_url: NUMBERS_NETWORK_ACTION_QA_URL
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Check if version has been updated
id: version_check
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install
npm install --legacy-peer-deps
npm run build

- name: Set up JDK 17
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Install Ionic CLI
run: npm install -g @ionic/cli
Expand All @@ -26,7 +26,7 @@ jobs:
run: npm run preconfig.npmrc

- name: Install dependencies
run: npm install
run: npm install --legacy-peer-deps

- name: Build Ionic
env:
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
if: github.actor != 'dependabot[bot]'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Install Ionic CLI
run: npm install -g @ionic/cli
Expand All @@ -73,7 +73,7 @@ jobs:
run: npm run preconfig.npmrc

- name: Install dependencies
run: npm install
run: npm install --legacy-peer-deps

- name: Build Ionic
env:
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
needs: [android, ios]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand All @@ -127,7 +127,7 @@ jobs:
if: ${{ failure() && github.actor != 'dependabot[bot]'}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand Down
144 changes: 144 additions & 0 deletions .github/workflows/firebase-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: firebase-release

on:
push:
tags:
- 'firebase-*'

jobs:
distribute-android:
runs-on: ubuntu-latest
timeout-minutes: 120

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20.11.1'

- name: Setup firebase
run: |
curl -sL https://firebase.tools | bash

- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # https://github.com/actions/setup-java#supported-distributions
java-version: '17'

- name: Build Android release bundle (AAB) for Firebase
run: |
npx cap sync android
cd android/
./gradlew bundleRelease

- name: Sign release AAB
uses: r0adkll/sign-android-release@v1.0.4
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE_FILE }}
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}

- name: Distribute Android App to Firebase
env:
APP_ID: ${{ secrets.FIREBASE_ANDROID_APP_ID }}
TEST_GROUPS: ${{ secrets.FIREBASE_TEST_GROUPS }}
GOOGLE_APPLICATION_CREDENTIALS: service_account.json
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
run: |
echo "$GOOGLE_APPLICATION_CREDENTIALS_CONTENT" > "$GOOGLE_APPLICATION_CREDENTIALS"
firebase appdistribution:distribute ./android/app/build/outputs/bundle/release/app-release.aab --app ${APP_ID} --groups "${TEST_GROUPS}"

distribute-ios:
runs-on: macos-latest
timeout-minutes: 120

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20.11.1'

- name: Setup firebase
run: |
curl -sL https://firebase.tools | bash

- name: Build Ionic
env:
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
NUMBERS_STORAGE_TRUSTED_CLIENT_KEY: ${{ secrets.NUMBERS_STORAGE_TRUSTED_CLIENT_KEY }}
NUMBERS_BUBBLE_DB_URL: ${{ secrets.NUMBERS_BUBBLE_DB_URL }}
NUMBERS_BUBBLE_IFRAME_URL: ${{ secrets.NUMBERS_BUBBLE_IFRAME_URL }}
BUBBLE_API_URL: ${{ secrets.BUBBLE_API_URL }}
APPS_FLYER_DEV_KEY: ${{ secrets.APPS_FLYER_DEV_KEY }}
NUMBERS_PQINA_NPM_KEY: ${{ secrets.NUMBERS_PQINA_NPM_KEY }}
PIPEDREAM_DELETE_CAPTURE_ACCOUNT: ${{ secrets.PIPEDREAM_DELETE_CAPTURE_ACCOUNT }}
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install --legacy-peer-deps
npm run build

- name: Import the Code-Signing PKCS12 Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}

- name: Download provisioning profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: io.numbersprotocol.capturelite
profile-type: 'IOS_APP_ADHOC'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }}

- name: Get current time
uses: 1466587594/get-current-time@v2
id: current-time
with:
format: YYYYMMDDHHmmss

- name: Build iOS Xcode Archive
env:
PROVISIONING_PROFILE: ${{ secrets.FIREBASE_PROVISIONING_PROFILE_NAME }}
run: |
npx cap sync ios
sed -i '' "s/NumbersAppDistributionV6/${PROVISIONING_PROFILE}/g" ios/App/ExportOptions.plist
sed -i '' 's/app-store/ad-hoc/g' ios/App/ExportOptions.plist
xcodebuild archive -workspace ios/App/App.xcworkspace -scheme App -sdk iphoneos -configuration Release -archivePath build/App.xcarchive -showBuildTimingSummary CURRENT_PROJECT_VERSION=${{ steps.current-time.outputs.formattedTime }} PROVISIONING_PROFILE_SPECIFIER=${PROVISIONING_PROFILE} -allowProvisioningUpdates

- name: Export IPA from Xcode Archive
run: |
xcodebuild -exportArchive -archivePath build/App.xcarchive -exportPath build -exportOptionsPlist ios/App/ExportOptions.plist -allowProvisioningUpdates

- name: Distribute iOS App to Firebase
env:
APP_ID: ${{ secrets.FIREBASE_IOS_APP_ID }}
TEST_GROUPS: ${{ secrets.FIREBASE_TEST_GROUPS }}
GOOGLE_APPLICATION_CREDENTIALS: service_account.json
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
run: |
echo "$GOOGLE_APPLICATION_CREDENTIALS_CONTENT" > "$GOOGLE_APPLICATION_CREDENTIALS"
firebase appdistribution:distribute build/App.ipa --app ${APP_ID} --groups "${TEST_GROUPS}"
34 changes: 17 additions & 17 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Get release version
id: version_check
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install
npm install --legacy-peer-deps
npm run build

- name: Set up JDK 17
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-android-qa
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download debug APK
uses: actions/download-artifact@v3
Expand All @@ -89,11 +89,11 @@ jobs:
timeout-minutes: 120

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Get release version
id: version_check
Expand All @@ -112,7 +112,7 @@ jobs:
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install
npm install --legacy-peer-deps
npm run build

- name: Set up JDK 17
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
timeout-minutes: 120

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download release AAB
uses: actions/download-artifact@v3
Expand All @@ -172,11 +172,11 @@ jobs:
continue-on-error: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.15.0'
node-version: '20.11.1'

- name: Get release version
id: version_check
Expand All @@ -195,7 +195,7 @@ jobs:
run: |
npm run preconfig.npmrc
npm install -g @ionic/cli
npm install
npm install --legacy-peer-deps
npm run build

- name: Import the Code-Signing PKCS12 Certificate
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
continue-on-error: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download IPA
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
runs-on: ubuntu-latest
needs: deploy-app-store
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download iOS build number
uses: actions/download-artifact@v2
Expand All @@ -297,7 +297,7 @@ jobs:
runs-on: ubuntu-latest
needs: [deploy-play-store, get-ios-build-number]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get release version
id: version_check
Expand Down
Loading
Loading