Skip to content

Commit

Permalink
Remove Firebase APK distribution (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaisting-livefront authored Oct 17, 2024
1 parent d07a9dc commit 8abe62e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 33 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build

on:
push:
branches:
- main
workflow_dispatch:
inputs:
version-name:
Expand All @@ -11,6 +14,11 @@ on:
description: "Optional. Build number to use. Overrides default of GitHub run number."
required: false
type: number
distribute-to-firebase:
description: "Optional. Distribute artifacts to Firebase."
required: false
default: false
type: boolean
publish-to-play-store:
description: "Optional. Deploy bundle artifact to Google Play Store"
required: false
Expand Down Expand Up @@ -120,6 +128,7 @@ jobs:
--name authenticator_aab-keystore.jks --file ${{ github.workspace }}/keystores/authenticator_aab-keystore.jks --output none
- name: Download Firebase credentials
if : ${{ inputs.distribute-to-firebase || github.event_name == 'push' }}
env:
ACCOUNT_NAME: bitwardenci
CONTAINER_NAME: mobile
Expand Down Expand Up @@ -230,19 +239,11 @@ jobs:
if-no-files-found: error

- name: Install Firebase app distribution plugin
if: ${{ github.ref_name == 'main' }}
if: ${{ inputs.distribute-to-firebase || github.event_name == 'push' }}
run: bundle exec fastlane add_plugin firebase_app_distribution

- name: Publish release artifacts to Firebase
if: ${{ github.ref_name == 'main' && matrix.variant == 'apk' }}
env:
FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/authenticator_play_firebase-creds.json
run: |
bundle exec fastlane distributeReleaseToFirebase \
serviceCredentialsFile:${{ env.FIREBASE_CREDS_PATH }}
- name: Publish release bundle to Firebase
if: ${{ github.ref_name == 'main' && matrix.variant == 'aab' }}
if: ${{ matrix.variant == 'aab' && (inputs.distribute-to-firebase || github.event_name == 'push' }}
env:
FIREBASE_CREDS_PATH: ${{ github.workspace }}/secrets/authenticator_play_firebase-creds.json
run: |
Expand Down
27 changes: 4 additions & 23 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ platform :android do
)
end

desc "Publish release to Firebase"
lane :distributeReleaseToFirebase do |options|
desc "Publish release AAB to Firebase"
lane :distributeReleaseBundleToFirebase do |options|
release_notes = changelog_from_git_commits(
commits_count: 1,
pretty: "- %s"
Expand All @@ -105,33 +105,14 @@ platform :android do

firebase_app_distribution(
app: "1:867301491091:android:50b626dba42a361651e866",
android_artifact_type: "APK",
android_artifact_path: "app/build/outputs/apk/release/com.bitwarden.authenticator-release.apk",
android_artifact_type: "AAB",
android_artifact_path: "app/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab",
service_credentials_file: options[:serviceCredentialsFile],
groups: "internal-prod-group",
release_notes: release_notes,
)
end

desc "Publish release AAB to Firebase"
lane :distributeReleaseBundleToFirebase do |options|
release_notes = changelog_from_git_commits(
commits_count: 1,
pretty: "- %s"
)

puts "Release notes #{release_notes}"

firebase_app_distribution(
app: "1:867301491091:android:50b626dba42a361651e866",
android_artifact_type: "AAB",
android_artifact_path: "app/build/outputs/bundle/release/com.bitwarden.authenticator-release.aab",
service_credentials_file: options[:serviceCredentialsFile],
groups: "internal-prod-group",
release_notes: release_notes,
)
end

desc "Publish release to Google Play Store"
lane :publishReleaseToGooglePlayStore do |options|
upload_to_play_store(
Expand Down

0 comments on commit 8abe62e

Please sign in to comment.