diff --git a/.azure-pipelines-canary.yml b/.azure-pipelines-canary.yml index fcd8692b..a0cfc9ad 100644 --- a/.azure-pipelines-canary.yml +++ b/.azure-pipelines-canary.yml @@ -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: diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 05b9fc6f..1aeb2ec7 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -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: @@ -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 diff --git a/build/stage-release-appcenter.yml b/build/stage-release-appcenter.yml deleted file mode 100644 index 69496323..00000000 --- a/build/stage-release-appcenter.yml +++ /dev/null @@ -1,110 +0,0 @@ -parameters: - applicationEnvironment: '' # e.g. "Staging", "Production" - deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter" - appCenterWindowsSlug: '' - appCenteriOSSlug: '' - appCenterAndroidSlug: '' - androidKeyStoreFile: '' - androidVariableGroup: '' - appCenterServiceConnectionName: '' - appCenterDistributionGroup: '' - -jobs: -- deployment: AppCenter_Android - pool: - vmImage: $(windowsHostedAgentImage) - variables: - - name: artifactName - value: $(AndroidArtifactName)_${{ parameters.applicationEnvironment }} - - name: releaseNotesArtifactName - value: ReleaseNotes_${{ parameters.applicationEnvironment }} - - group: ${{ parameters.androidVariableGroup }} - environment: ${{ parameters.deploymentEnvironment }} - strategy: - runOnce: - deploy: - steps: - - download: current - displayName: "Download Artifact" - artifact: $(artifactName) - - - download: current - displayName: "Download Release Notes" - artifact: $(releaseNotesArtifactName) - - - task: AppCenterDistribute@3 - displayName: Deploy Android to AppCenter - inputs: - serverEndpoint: ${{ parameters.appCenterServiceConnectionName }} - distributionGroupId: ${{ parameters.appCenterDistributionGroup }} - appSlug: ${{ parameters.appCenterAndroidSlug }} - appFile: '$(Pipeline.Workspace)/$(artifactName)/*Signed.aab' - releaseNotesOption: file - releaseNotesFile: "$(Pipeline.Workspace)/$(releaseNotesArtifactName)/ReleaseNotes-Excerpt.md" - isSilent: true - - - 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: '**' - -- deployment: AppCenter_iOS - pool: - vmImage: $(macOSHostedAgentImage) - variables: - - name: artifactName - value: $(iOSArtifactName)_${{ parameters.applicationEnvironment }} - - name: releaseNotesArtifactName - value: ReleaseNotes_${{ parameters.applicationEnvironment }} - environment: ${{ parameters.deploymentEnvironment }} - strategy: - runOnce: - deploy: - steps: - - download: current - displayName: "Download Artifact" - artifact: $(artifactName) - - - download: current - displayName: "Download Release Notes" - artifact: $(releaseNotesArtifactName) - - - task: AppCenterDistribute@3 - displayName: Deploy iOS to AppCenter - inputs: - serverEndpoint: ${{ parameters.appCenterServiceConnectionName }} - appSlug: ${{ parameters.appCenteriOSSlug }} - appFile: $(Pipeline.Workspace)/$(artifactName)/*.ipa - symbolsDsymFiles: $(Pipeline.Workspace)/$(artifactName)/*.dSYM - symbolsIncludeParentDirectory: true - distributionGroupId: ${{ parameters.appCenterDistributionGroup }} - releaseNotesOption: file - releaseNotesFile: "$(Pipeline.Workspace)/$(releaseNotesArtifactName)/ReleaseNotes-Excerpt.md" - isSilent: true - - - 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: '**' diff --git a/build/stage-release-firebase.yml b/build/stage-release-firebase.yml new file mode 100644 index 00000000..d52ef3bd --- /dev/null +++ b/build/stage-release-firebase.yml @@ -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' \ No newline at end of file diff --git a/build/templates/firebase-deploy.yml b/build/templates/firebase-deploy.yml new file mode 100644 index 00000000..9fe6132a --- /dev/null +++ b/build/templates/firebase-deploy.yml @@ -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() \ No newline at end of file diff --git a/build/variables.yml b/build/variables.yml index b71d01b4..d138b1e1 100644 --- a/build/variables.yml +++ b/build/variables.yml @@ -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. @@ -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: @@ -74,6 +77,7 @@ # Virtual machine images windowsHostedAgentImage: 'windows-2022' macOSHostedAgentImage: 'macOS-13' + linuxHostedAgentImage: 'ubuntu-22.04' # SDK versions DotNetVersion: '7.0.400' diff --git a/src/ApplicationTemplate.sln b/src/ApplicationTemplate.sln index fcc4a9db..3e632392 100644 --- a/src/ApplicationTemplate.sln +++ b/src/ApplicationTemplate.sln @@ -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