Skip to content

Commit

Permalink
feat!: swap appcenter for firebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Takla committed Jun 13, 2024
1 parent d59474d commit 3204311
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 148 deletions.
25 changes: 13 additions & 12 deletions .azure-pipelines-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ stages:
condition: and(succeeded(), eq(variables['IsCanary'], 'true'))
dependsOn: Build_Canary

jobs:
- template: build/stage-release-appcenter.yml
parameters:
applicationEnvironment: Staging
deploymentEnvironment: AppCenter
appCenterWindowsSlug: $(AppCenterWindowsSlug_Canary)
appCenteriOSSlug: $(AppCenteriOSSlug_Canary)
appCenterAndroidSlug: $(AppCenterAndroidSlug_Canary)
androidKeyStoreFile: $(InternalKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
appCenterServiceConnectionName: $(AppCenterCanaryServiceConnection)
appCenterDistributionGroup: $(AppCenterCanaryDistributionGroup)
# TODO create firebase project for the canary app
# jobs:
# - template: build/stage-release-appcenter.yml
# parameters:
# applicationEnvironment: Staging
# deploymentEnvironment: AppCenter
# appCenterWindowsSlug: $(AppCenterWindowsSlug_Canary)
# appCenteriOSSlug: $(AppCenteriOSSlug_Canary)
# appCenterAndroidSlug: $(AppCenterAndroidSlug_Canary)
# androidKeyStoreFile: $(InternalKeystore)
# androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
# appCenterServiceConnectionName: $(AppCenterCanaryServiceConnection)
# appCenterDistributionGroup: $(AppCenterCanaryDistributionGroup)

- template: build/stage-release-appstore.yml
parameters:
Expand Down
27 changes: 3 additions & 24 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,16 @@ stages:
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'
BannerVersionNameText: "STAGING"

- stage: AppCenter_TestFlight_Staging
- stage: Firebase_TestFlight_Staging
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
dependsOn: Build_Staging
jobs:
- template: build/stage-release-appcenter.yml
- template: build/stage-release-firebase.yml
parameters:
applicationEnvironment: Staging
deploymentEnvironment: AppCenter
appCenterWindowsSlug: $(AppCenterWindowsSlug)
appCenteriOSSlug: $(AppCenteriOSSlug)
appCenterAndroidSlug: $(AppCenterAndroidSlug)
androidKeyStoreFile: $(InternalKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
appCenterServiceConnectionName: $(AppCenterServiceConnection)
appCenterDistributionGroup: $(AppCenterDistributionGroup)
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.Ios'

# - template: build/stage-release-appstore.yml
# parameters:
Expand All @@ -110,22 +105,6 @@ stages:
iosCertificateFile: $(AppStoreCertificate)
iosVariableGroup: 'ApplicationTemplate.Distribution.AppStore'

- stage: AppCenter_Production
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
dependsOn: Build_Production
jobs:
- template: build/stage-release-appcenter.yml
parameters:
applicationEnvironment: Production
deploymentEnvironment: 'AppCenter Prod'
appCenterWindowsSlug: $(AppCenterWindowsSlug_Production)
appCenteriOSSlug: $(AppCenteriOSSlug_Production)
appCenterAndroidSlug: $(AppCenterAndroidSlug_Production)
androidKeyStoreFile: $(GooglePlayKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.GooglePlay'
appCenterServiceConnectionName: $(AppCenterServiceConnection)
appCenterDistributionGroup: $(AppCenterDistributionGroup)

- stage: AppStore
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
dependsOn: Build_Production
Expand Down
110 changes: 0 additions & 110 deletions build/stage-release-appcenter.yml

This file was deleted.

42 changes: 42 additions & 0 deletions build/stage-release-firebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter"
androidVariableGroup: ''
iosVariableGroup: ''

jobs:
- deployment: Firebase_Android
pool:
vmImage: $(linuxHostedAgentImage)
variables:
- name: artifactName
value: $(AndroidArtifactName)_${{ parameters.applicationEnvironment }}
- name: releaseNotesArtifactName
value: ReleaseNotes_${{ parameters.applicationEnvironment }}
- group: ${{ parameters.androidVariableGroup }}
environment: ${{ parameters.deploymentEnvironment }}
strategy:
runOnce:
deploy:
steps:
- template: ./templates/firebase-deploy.yml
parameters:
fileName: '$(ApplicationIdentifier)-Signed.apk'

- deployment: Firebase_iOS
pool:
vmImage: $(linuxHostedAgentImage)
variables:
- name: artifactName
value: $(iOSArtifactName)_${{ parameters.applicationEnvironment }}
- name: releaseNotesArtifactName
value: ReleaseNotes_${{ parameters.applicationEnvironment }}
- group: ${{ parameters.iosVariableGroup }}
environment: ${{ parameters.deploymentEnvironment }}
strategy:
runOnce:
deploy:
steps:
- template: ./templates/firebase-deploy.yml
parameters:
fileName: '$(SolutionName).Mobile.ipa'
50 changes: 50 additions & 0 deletions build/templates/firebase-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
parameters:
fileName: ''

steps:
# Install Firebase tools
- script: 'npm install -g firebase-tools'
displayName: 'Install Firebase Tools'

- download: current
displayName: "Download Artifact"
artifact: $(artifactName)

- download: current
displayName: "Download Release Notes"
artifact: $(releaseNotesArtifactName)

- task: DownloadSecureFile@1
inputs:
secureFile: $(FirebaseDistributionServiceConnectionFile)
name: DistributionServiceConnection
displayName: "Download Firebase Service connection"

- script: |
firebase appdistribution:distribute '$(Pipeline.Workspace)/$(artifactName)/${{ parameters.fileName }}' \
--app '$(FirebaseAppId)' \
--release-notes-file '$(Pipeline.Workspace)/$(releaseNotesArtifactName)/ReleaseNotes-Excerpt.md' \
--groups "nventive"
env:
GOOGLE_APPLICATION_CREDENTIALS: $(DistributionServiceConnection.secureFilePath)
displayName: 'Deploy to Firebase'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Build)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(artifactName)
RemoveSourceFolder: true
Contents: '**'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Release Notes)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(releaseNotesArtifactName)
RemoveSourceFolder: true
Contents: '**'

- task: PostBuildCleanup@3
displayName: 'Post-Build Cleanup: Cleanup files to keep build server clean!'
condition: always()
6 changes: 5 additions & 1 deletion build/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
InternalKeystore: com.nventive.internal.applicationtemplate.jks # This is the internal keystore used for internal builds.
GooglePlayKeystore: com.nventive.applicationtemplate.jks # This is the official keystore used for Google Play.
# iOS
InternalProvisioningProfile: com.nventive.applicationtemplate.mobileprovision # This is the internal provisioning profile for internal builds.
InternalProvisioningProfile: com.nventive.applicationtemplate-adhoc.mobileprovision # This is the internal provisioning profile for internal builds.
InternalCertificate: nventive.p12 # This is the certificate from the nventive Apple account used to sign internal builds.
AppStoreProvisioningProfile: com.nventive.applicationtemplate.mobileprovision # This is the client provisioning profile for the AppStore (Production distribution).
AppStoreCertificate: nventive.p12 # This is the client production certificate used to sign AppStore builds.
Expand Down Expand Up @@ -60,6 +60,9 @@
AppCenterDistributionGroup: '00000000-0000-0000-0000-000000000000'
AppCenterCanaryDistributionGroup: '00000000-0000-0000-0000-000000000000'

# Firebase distribution
FirebaseDistributionServiceConnectionFile: 'firebase_unoapptemplate_dist.json'

# Azure subscription
# AzureSubscriptionName:
# AzureStorageAccountName:
Expand All @@ -74,6 +77,7 @@
# Virtual machine images
windowsHostedAgentImage: 'windows-2022'
macOSHostedAgentImage: 'macOS-13'
linuxHostedAgentImage: 'ubuntu-22.04'

# SDK versions
DotNetVersion: '7.0.400'
Expand Down
2 changes: 1 addition & 1 deletion src/ApplicationTemplate.sln
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6E8378CB
..\build\canary-merge.yml = ..\build\canary-merge.yml
..\build\gitversion-config.yml = ..\build\gitversion-config.yml
..\build\stage-build.yml = ..\build\stage-build.yml
..\build\stage-release-appcenter.yml = ..\build\stage-release-appcenter.yml
..\build\stage-release-firebase.yml = ..\build\stage-release-firebase.yml
..\build\stage-release-appstore.yml = ..\build\stage-release-appstore.yml
..\build\stage-release-googleplay.yml = ..\build\stage-release-googleplay.yml
..\build\steps-build-android.yml = ..\build\steps-build-android.yml
Expand Down

0 comments on commit 3204311

Please sign in to comment.