Skip to content

Commit db59e7c

Browse files
committed
ci: Replace App Center with Firebase for Android distribution
1 parent af371d8 commit db59e7c

File tree

8 files changed

+64
-136
lines changed

8 files changed

+64
-136
lines changed

.azure-pipelines-canary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ stages:
2323
removeHyperlinksFromReleaseNotes: true
2424
BannerVersionNameText: "CANARY"
2525

26-
- stage: AppCenter_TestFlight_Canary
26+
- stage: FirebaseDistribution_TestFlight_Canary
2727
condition: and(succeeded(), eq(variables['IsCanary'], 'true'))
2828
dependsOn: Build_Canary
2929

3030
jobs:
31-
- template: build/stage-release-appcenter.yml
31+
- template: build/stage-release-firebase-app-distribution.yml
3232
parameters:
3333
applicationEnvironment: Staging
3434
deploymentEnvironment: AppCenter

.azure-pipelines.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ trigger:
2323
- main
2424

2525
variables:
26+
- name: system.debug
27+
value: true
2628
#-if false
2729
- name: IsReleaseBranch
2830
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
@@ -80,21 +82,17 @@ stages:
8082
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'
8183
BannerVersionNameText: "STAGING"
8284

83-
- stage: AppCenter_TestFlight_Staging
85+
- stage: FirebaseDistribution_TestFlight_Staging
8486
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
8587
dependsOn: Build_Staging
8688
jobs:
87-
- template: build/stage-release-appcenter.yml
89+
- template: build/stage-release-firebase-app-distribution.yml
8890
parameters:
8991
applicationEnvironment: Staging
90-
deploymentEnvironment: AppCenter
91-
appCenterWindowsSlug: $(AppCenterWindowsSlug)
92-
appCenteriOSSlug: $(AppCenteriOSSlug)
93-
appCenterAndroidSlug: $(AppCenterAndroidSlug)
94-
androidKeyStoreFile: $(InternalKeystore)
92+
deploymentEnvironment: Firebase App Distribution
9593
androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
96-
appCenterServiceConnectionName: $(AppCenterServiceConnection)
97-
appCenterDistributionGroup: $(AppCenterDistributionGroup)
94+
serviceConnectionKeyFileName: $(FirebaseAppDistributionServiceConnection)
95+
artifactFileName: 'com.nventive.internal.applicationtemplate-Signed.apk'
9896

9997
- template: build/stage-release-appstore.yml
10098
parameters:
@@ -114,21 +112,17 @@ stages:
114112
iosCertificateFile: $(AppStoreCertificate)
115113
iosVariableGroup: 'ApplicationTemplate.Distribution.AppStore'
116114

117-
- stage: AppCenter_Production
115+
- stage: FirebaseDistribution_Production
118116
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
119117
dependsOn: Build_Production
120118
jobs:
121-
- template: build/stage-release-appcenter.yml
119+
- template: build/stage-release-firebase-app-distribution.yml
122120
parameters:
123121
applicationEnvironment: Production
124-
deploymentEnvironment: 'AppCenter Prod'
125-
appCenterWindowsSlug: $(AppCenterWindowsSlug_Production)
126-
appCenteriOSSlug: $(AppCenteriOSSlug_Production)
127-
appCenterAndroidSlug: $(AppCenterAndroidSlug_Production)
128-
androidKeyStoreFile: $(GooglePlayKeystore)
122+
deploymentEnvironment: Firebase App Distribution
129123
androidVariableGroup: 'ApplicationTemplate.Distribution.GooglePlay'
130-
appCenterServiceConnectionName: $(AppCenterServiceConnection)
131-
appCenterDistributionGroup: $(AppCenterDistributionGroup)
124+
serviceConnectionKeyFileName: $(FirebaseAppDistributionServiceConnection)
125+
artifactFileName: 'com.nventive.applicationtemplate-Signed.apk'
132126

133127
- stage: AppStore
134128
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Prefix your items with `(Template)` if the change is about the template and not
77

88
## 3.6.X
99
- Added conventional commit validation stage `stage-commit-validation.yml`
10+
- Replacing Appcenter with Firebase app distribution for android.
1011

1112
## 3.5.X
1213
- Bump Uno packages to 5.2.121 to fix a crash on iOS.

build/stage-release-appcenter.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
parameters:
2+
applicationEnvironment: '' # e.g. "Staging", "Production"
3+
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter" "Firebase App Distribution"
4+
androidVariableGroup: ''
5+
artifactFileName: ''
6+
serviceConnectionKeyFileName: ""
7+
8+
jobs:
9+
- deployment: Firebase_Android
10+
pool:
11+
vmImage: $(windowsHostedAgentImage)
12+
variables:
13+
- group: ${{ parameters.androidVariableGroup }}
14+
- name: pathToAab
15+
value: '$(Pipeline.Workspace)/$(AndroidArtifactName)_${{ parameters.applicationEnvironment }}/${{ parameters.artifactFileName }}'
16+
environment: ${{ parameters.deploymentEnvironment }}
17+
strategy:
18+
runOnce:
19+
deploy:
20+
steps:
21+
# Step 1: Install Firebase tools
22+
- script: "npm install -g firebase-tools"
23+
displayName: "Install Firebase Tools"
24+
25+
# Step 2: Download the service connection key file
26+
- task: DownloadSecureFile@1
27+
inputs:
28+
secureFile: ${{ parameters.serviceConnectionKeyFileName }}
29+
name: DistributionServiceConnection
30+
displayName: "Download Firebase Service Connection"
31+
32+
# Step 3: Deploy to Firebase App Distribution
33+
- script: |
34+
echo "Deploying to Firebase App Distribution..."
35+
echo "App ID: $(FirebaseAppId)"
36+
echo "Path to AAB: $(pathToAab)"
37+
$pathWithBackslash = $(pathToAab -replace '/', '\')
38+
echo "Path with backslash: $pathWithBackslash"
39+
firebase appdistribution:distribute $(pathToAab) --app $(FirebaseAppId) --release-notes "UnoApplicationTemplate" --groups "nventive" --debug
40+
env:
41+
GOOGLE_APPLICATION_CREDENTIALS: $(DistributionServiceConnection.secureFilePath)
42+
displayName: "Deploy to Firebase"

build/variables.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
AppCenterServiceConnection: AppCenter-nventive-framework
4343
AppStoreServiceConnection: AppStore-nventive
4444
AppCenterCanaryServiceConnection: AppCenter-nventive-framework
45+
FirebaseAppDistributionServiceConnection: com.nventive.applicationtemplate.firebaseappdistribution.json
4546

4647
# AppCenter slugs
4748
# The "app slug" corresponds to the identifiers of the app in AppCenter; to find it, navigate to the app in a browser and;

doc/AzurePipelines.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Azure Pipelines
1+
# Azure Pipelines
22

33
## Pipeline Code
44
This project uses CI/CD pipelines that are implemented as yaml code.
@@ -18,7 +18,7 @@ These pipelines rely on a few variable groups and secrets in order to fully work
1818

1919
At high level, the CI/CD pipelines do the following:
2020
- **Build** the app in **staging**.
21-
- **Deploy** the staging app (to AppCenter and/or TestFlight and GooglePlay).
21+
- **Deploy** the staging app (to Firebase app distribution and/or TestFlight).
2222
- **Build** the app in **production**.
2323
- **Deploy** the production app (to TestFlight and GooglePlay).
2424

@@ -68,8 +68,8 @@ This is where the exact build steps are defined. These vary depending on the pla
6868

6969
The release stages are even more straigtforward than the build ones. One thing to note is that, for the same reason as it is done at the end of the build steps, a clean-up step is included in every stage.
7070

71-
### AppCenter Release Stage ([stage-release-appcenter.yml](../build/stage-release-appcenter.yml))
72-
This stage is in charge of pushing the application to AppCenter. It's divided into 2 jobs, one for each platform.
71+
### Firebase app distribution Release Stage ([stage-release-firebase-app-distribution.yml](../build/stage-release-firebase-app-distribution.yml))
72+
This stage is in charge of pushing the application to Firebase app distribution. Only for Android.
7373

7474
### Apple AppStore Release Stage ([stage-release-appstore.yml](../build/stage-release-appstore.yml))
7575
This stage is in charge of pushing the iOS version to the Apple AppStore. Given that the build stage signs the application, this is as simple as using the proper task and pushing the **IPA** file. This should only be run for configurations that properly sign the application.
@@ -102,4 +102,4 @@ This pipelines creates a branch on which it commits a version of the latest code
102102
### Canary Deployment
103103
This pipelines triggers automatically when a new branch is created and pushed by the previous pipeline. It takes the new code, builds it, and deploys so that it can be manually tested.
104104

105-
This pipeline uses the same build and release stages as the main CI/CD pipeline of the app.
105+
This pipeline uses the same build and release stages as the main CI/CD pipeline of the app.

src/ApplicationTemplate.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6E8378CB
6464
..\build\canary-merge.yml = ..\build\canary-merge.yml
6565
..\build\gitversion-config.yml = ..\build\gitversion-config.yml
6666
..\build\stage-build.yml = ..\build\stage-build.yml
67-
..\build\stage-release-appcenter.yml = ..\build\stage-release-appcenter.yml
67+
..\build\stage-release-firebase-app-distribution.yml = ..\build\stage-release-firebase-app-distribution.yml
6868
..\build\stage-release-appstore.yml = ..\build\stage-release-appstore.yml
6969
..\build\stage-release-googleplay.yml = ..\build\stage-release-googleplay.yml
7070
..\build\steps-build-android.yml = ..\build\steps-build-android.yml

0 commit comments

Comments
 (0)