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

Integrate firebase app distribution in the template for internal distribution [feature branch] #411

Merged
merged 9 commits into from
Jun 14, 2024
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
takla21 marked this conversation as resolved.
Show resolved Hide resolved
# 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)
takla21 marked this conversation as resolved.
Show resolved Hide resolved
# appCenterDistributionGroup: $(AppCenterCanaryDistributionGroup)

- template: build/stage-release-appstore.yml
parameters:
Expand Down
33 changes: 8 additions & 25 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ trigger:
- main

variables:
#-if false
- name: IsReleaseBranch
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
#-endif
- template: build/variables.yml

stages:
Expand All @@ -49,7 +53,7 @@ stages:
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'

- stage: Publish_Template_Package
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'), eq(variables['IsReleaseBranch'], 'true'))
dependsOn:
- Build_Staging_GeneratedApp
- Build_Staging
Expand All @@ -72,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 @@ -106,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
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ dotnet_diagnostic.SA1210.severity = suggestion
dotnet_diagnostic.CA1308.severity = none
# CS1587: XML comment is not placed on a valid language element
dotnet_diagnostic.CS1587.severity = none
# CA1859: Use concrete types when possible for improved performance
dotnet_diagnostic.CA1859.severity = none

# VSTHRD110: This one is bugged: https://github.com/microsoft/vs-threading/issues/899
dotnet_diagnostic.VSTHRD110.severity = none
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ GitHub Issue: #
### Always applicable
No matter your changes, these checks always apply.
- [ ] Your conventional commits are aligned with the **Impact on version** section.
- [ ] Updated [CHANGELOG.md](../CHANGELOG.md).
- [ ] Updated [CHANGELOG.md](../blob/main/CHANGELOG.md).
takla21 marked this conversation as resolved.
Show resolved Hide resolved
- Use the latest Major.Minor.X header if you do a **Patch** change.
- Create a new Major.Minor.X header if you do a **Minor** or **Major** change.
- If you create a new header, it aligns with the **Impact on version** section and matches what is generated in the build pipeline.
Expand Down
7 changes: 4 additions & 3 deletions APP_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ This repository was generated using the **nventive Mobile Template**.
### Local Development Requirements
All development is expected to be done from Visual Studio in a Windows environment.

- .Net 7
- .NET 8
- Visual Studio 2022 (17.4 and above)
- We recommend validating your components using this [Uno guide](https://platform.uno/docs/articles/get-started-vs-2022.html).
- For mobile development, MAUI workloads are required.
- You can install them using [`uno-check`](https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html).
- For local iOS compilation and debugging, you need access to Mac with Xcode 14.2 (more recent versions may work too).
> 💡 You'll need an [Apple provisioning profile](https://developer.apple.com/help/account/manage-profiles/create-a-development-provisioning-profile/) to start your application.

### Pipelines Requirements
The pipelines (for continuous integration, testing, and delivery) of this project are made for [Azure Pipelines](https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/what-is-azure-pipelines?view=azure-devops).
Expand Down Expand Up @@ -80,10 +81,10 @@ TODO: Fill the following table with your own pipelines.
| Link | Code Entry Point | Goal | Triggers |
|-|-|-|-|
| [Name of Main Pipeline](link-to-pipeline)| [`.azure-pipelines.yml`](.azure-pipelines.yml)| Build validation during pull request.| Pull requests.
| [Name of Main Pipeline](link-to-pipeline)| [`.azure-pipelines.yml`](.azure-pipelines.yml)| Build and deploy the application to AppCenter, TestFlight, and GooglePlay. | Changes on the `main` branch.<br/>Manual trigger.
| [Name of Main Pipeline](link-to-pipeline)| [`.azure-pipelines.yml`](.azure-pipelines.yml)| Build and deploy the application to Firebase, TestFlight, and GooglePlay. | Changes on the `main` branch.<br/>Manual trigger.
| [Name of API Integration Tests Pipeline](link-to-pipeline)| [`.azure-pipelines-api-integration-tests.yml`](.azure-pipelines.yml)| Run all tests, including APIs integration tests. | Daily cron job.<br/>Manual trigger.
| [Name of Canary Merge Pipeline](link-to-pipeline)| [`build/canary-merge.yml`](.azure-pipelines.yml)| Creation of canary branches (`canary/build/*`). | Daily cron job.
| [Name of Canary Pipeline](link-to-pipeline)| [`.azure-pipelines-canary.yml`](.azure-pipelines.yml)| Build and deploy canary versions of the app to AppCenter and TestFlight. | Upon creation of branches with the `canary/build/*` pattern.
| [Name of Canary Pipeline](link-to-pipeline)| [`.azure-pipelines-canary.yml`](.azure-pipelines.yml)| Build and deploy canary versions of the app to Firebase and TestFlight. | Upon creation of branches with the `canary/build/*` pattern.


## Additional Information
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

Prefix your items with `(Template)` if the change is about the template and not the resulting application.

## 4.0.x
- Using Firebase app distribution instead of AppCenter for internal distribution.

## 3.5.X
- Bump Uno packages to 5.2.121 to fix a crash on iOS.
- Ensure NV.Template.Mobile nuget is only deployed from the main branch.

## 3.4.X
- Added a kill switch feature to the app.
- Bump Uno.WinUI, Uno.WinUI.DevServer, Uno.WinUI.Lottie and Uno.UI.Adapter.Microsoft.Extensions.Logging to 5.0.159 to fix backNavigation/CloseModal crash.
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<!-- Microsoft.VisualStudio.Threading.Analyzers has the async void analyzers. -->
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22" PrivateAssets="all" />
<PackageReference Include="GooseAnalyzers" Version="0.2.0" PrivateAssets="all" />
<PackageReference Include="GooseAnalyzers" Version="1.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Uno Platform Application Template
# Uno Platform Application Template

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](LICENSE) ![Version](https://img.shields.io/nuget/v/NV.Templates.Mobile?style=flat-square) ![Downloads](https://img.shields.io/nuget/dt/NV.Templates.Mobile?style=flat-square)

Expand All @@ -21,7 +21,7 @@ From left to right: WinUI, iOS, and Android.

## Requirements

Visual Studio 2022 with .Net 7 are required.
Visual Studio 2022 with .NET 8 are required.

This template largely relies on Uno Platform, if you want to make sure you got everything installed correctly on your machine, we encourage you to use `uno-check`, the documentation is available [here](https://platform.uno/docs/articles/uno-check.html)

Expand Down
110 changes: 0 additions & 110 deletions build/stage-release-appcenter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build/stage-release-appstore.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "Firebase"

jobs:
- deployment: AppStore_iOS_${{ parameters.deploymentEnvironment}}
Expand Down
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", "Firebase"
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'
2 changes: 1 addition & 1 deletion build/stage-release-googleplay.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "Firebase"

jobs:
- deployment: GooglePlay_Android
Expand Down
Loading