Merge pull request #129 from microsoft/feature/actions-ci-cd

Feature/actions ci cd
feature/use-flex-layout-listen-later-and-listen-together^2
Miguel Angel Barrera Muñoz 2022-05-13 14:28:07 +02:00 committed by GitHub
commit 7b24dd9855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 299 additions and 22 deletions

View File

@ -0,0 +1,133 @@
name: Podcast .NET MAUI Blazor CD
on:
push:
branches: [ main ]
paths:
- 'src/MobileBlazor/**'
- '**/*build.props'
- '.github/workflows/podcast-mobile-cd.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
ROOT_PATH: src/MobileBlazor/mauiapp/
CSPROJ_PATH: src/MobileBlazor/mauiapp/NetPodsMauiBlazor.csproj
ENCRYPTED_KEYSTORE_PATH: android-keystore-test.jks.gpg # RELATIVE TO github.workspace
KEYSTORE_PATH: android-keystore-test.keystore # RELATIVE TO github.workspace
ARTIFACTS_PATH: artifacts # RELATIVE TO github.workspace
ARTIFACTS_MACOS_PATH: artifacts_macos # RELATIVE TO github.workspace
jobs:
windows-build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
include-prerelease: true
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Install MAUI Workloads
run: |
dotnet workload install maui --source https://api.nuget.org/v3/index.json
# BUILD
- name: Restore dependencies
shell: pwsh
run: |
dotnet restore ${{ env.CSPROJ_PATH }}
- name: Build Maui WinUI project
shell: pwsh
run: |
msbuild "${{ env.CSPROJ_PATH }}" -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041.0
#POST-BUILD
- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: "WinUI .NET MAUI artifacts"
path: "${{ env.ROOT_PATH }}/bin/Release"
if-no-files-found: error
retention-days: 90
macos-build-android-macos-ios:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Decrypt keystore
shell: pwsh
run: |
cd ${{ github.workspace }}
gpg --quiet --batch --yes --decrypt --passphrase=${{ secrets.ANDROID_KEYSTORE_GPG_PASSWORD }} --output ${{env.ROOT_PATH}}${{ env.KEYSTORE_PATH }} ${{ env.ENCRYPTED_KEYSTORE_PATH }}
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
include-prerelease: true
- uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '11'
- name: Install MAUI Workloads
run: |
dotnet workload install maui --source https://api.nuget.org/v3/index.json
# BUILD
- name: Restore dependencies
shell: pwsh
run: |
dotnet restore ${{ env.CSPROJ_PATH }}
- name: Build MacCatalyst App
shell: bash
run: |
dotnet build ${{ env.CSPROJ_PATH }} -f net6.0-maccatalyst -c Release
dotnet publish ${{ env.CSPROJ_PATH }} -f net6.0-maccatalyst -c Release -p:BuildIpa=True
- name: Build MAUI Android
shell: pwsh
run: |
dotnet publish ${{ env.CSPROJ_PATH }} -c Release -f net6.0-android --no-restore /p:AndroidKeyStore=true /p:AndroidSigningKeyStore=${{ env.KEYSTORE_PATH }} /p:AndroidSigningStorePass=${{ secrets.ANDROID_SIGNING_STORE_PASS }} /p:AndroidSigningKeyAlias=${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} /p:AndroidSigningKeyPass=${{ secrets.ANDROID_SIGNING_KEY_PASS }}
#POST-BUILD
- name: Create artifacts folder
shell: pwsh
run: |
cd ${{ github.workspace }}
mkdir -p ${{ env.ARTIFACTS_MACOS_PATH }}
#TODO add filter and only upload signed artifacts
- name: Copy APKs
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.apk -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Copy AABs
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.aab -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Copy MacOS package
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.pkg -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: "Podcast MacOS artifacts"
path: "${{ env.ARTIFACTS_MACOS_PATH }}/*"
if-no-files-found: error
retention-days: 90

View File

@ -2,19 +2,20 @@ name: Podcast .NET MAUI Blazor CI
on:
push:
branches: [ main, maui/perf ]
branches: [ main ]
paths:
- 'src/Mobile/**'
- 'src/MobileBlazor/**'
- 'src/Web/Components/**'
- '**/*build.props'
- '.github/workflows/podcast-dotnet-maui-blazor.yml'
- '.github/workflows/podcast-dotnet-maui-blazor-ci.yml'
pull_request:
branches: [ main, maui/perf ]
branches:
- '**'
paths:
- 'src/Mobile/**'
- 'src/MobileBlazor/**'
- 'src/Web/Components/**'
- '**/*build.props'
- '.github/workflows/podcast-dotnet-maui-blazor.yml'
- '.github/workflows/podcast-dotnet-maui-blazor-ci.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

View File

@ -0,0 +1,133 @@
name: Podcast .NET MAUI CD
on:
push:
branches: [ main ]
paths:
- 'src/Mobile/**'
- '**/*build.props'
- '.github/workflows/podcast-mobile-cd.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
ROOT_PATH: src/Mobile/
CSPROJ_PATH: src/Mobile/Microsoft.NetConf2021.Maui.csproj
ENCRYPTED_KEYSTORE_PATH: android-keystore-test.jks.gpg # RELATIVE TO github.workspace
KEYSTORE_PATH: android-keystore-test.keystore # RELATIVE TO github.workspace
ARTIFACTS_PATH: artifacts # RELATIVE TO github.workspace
ARTIFACTS_MACOS_PATH: artifacts_macos # RELATIVE TO github.workspace
jobs:
windows-build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
include-prerelease: true
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Install MAUI Workloads
run: |
dotnet workload install maui --source https://api.nuget.org/v3/index.json
# BUILD
- name: Restore dependencies
shell: pwsh
run: |
dotnet restore ${{ env.CSPROJ_PATH }}
- name: Build Maui WinUI project
shell: pwsh
run: |
msbuild "${{ env.CSPROJ_PATH }}" -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041.0
#POST-BUILD
- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: "WinUI .NET MAUI artifacts"
path: "${{ env.ROOT_PATH }}/bin/Release"
if-no-files-found: error
retention-days: 90
macos-build-android-macos-ios:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Decrypt keystore
shell: pwsh
run: |
cd ${{ github.workspace }}
gpg --quiet --batch --yes --decrypt --passphrase=${{ secrets.ANDROID_KEYSTORE_GPG_PASSWORD }} --output ${{env.ROOT_PATH}}${{ env.KEYSTORE_PATH }} ${{ env.ENCRYPTED_KEYSTORE_PATH }}
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
include-prerelease: true
- uses: actions/setup-java@v2
with:
distribution: 'microsoft'
java-version: '11'
- name: Install MAUI Workloads
run: |
dotnet workload install maui --source https://api.nuget.org/v3/index.json
# BUILD
- name: Restore dependencies
shell: pwsh
run: |
dotnet restore ${{ env.CSPROJ_PATH }}
- name: Build MacCatalyst App
shell: bash
run: |
dotnet build ${{ env.CSPROJ_PATH }} -f net6.0-maccatalyst -c Release
dotnet publish ${{ env.CSPROJ_PATH }} -f net6.0-maccatalyst -c Release -p:BuildIpa=True
- name: Build MAUI Android
shell: pwsh
run: |
dotnet publish ${{ env.CSPROJ_PATH }} -c Release -f net6.0-android --no-restore /p:AndroidKeyStore=true /p:AndroidSigningKeyStore=${{ env.KEYSTORE_PATH }} /p:AndroidSigningStorePass=${{ secrets.ANDROID_SIGNING_STORE_PASS }} /p:AndroidSigningKeyAlias=${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} /p:AndroidSigningKeyPass=${{ secrets.ANDROID_SIGNING_KEY_PASS }}
#POST-BUILD
- name: Create artifacts folder
shell: pwsh
run: |
cd ${{ github.workspace }}
mkdir -p ${{ env.ARTIFACTS_MACOS_PATH }}
#TODO add filter and only upload signed artifacts
- name: Copy APKs
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.apk -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Copy AABs
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.aab -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Copy MacOS package
shell: pwsh
run: |
Get-Childitem Path ${{ github.workspace }} -Include *.pkg -File -Recurse | Copy-Item -Destination ${{ env.ARTIFACTS_MACOS_PATH }}
- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: "Podcast MacOS artifacts"
path: "${{ env.ARTIFACTS_MACOS_PATH }}/*"
if-no-files-found: error
retention-days: 90

View File

@ -2,19 +2,20 @@ name: Podcast .NET MAUI CI
on:
push:
branches: [ main, maui/perf ]
branches: [ main ]
paths:
- 'src/Mobile/**'
- 'src/Web/Components/**'
- '**/*build.props'
- '.github/workflows/podcast-dotnet-maui.yml'
- '.github/workflows/podcast-dotnet-maui-ci.yml'
pull_request:
branches: [ main, maui/perf ]
branches:
- '**'
paths:
- 'src/Mobile/**'
- 'src/Web/Components/**'
- '**/*build.props'
- '.github/workflows/podcast-dotnet-maui.yml'
- '.github/workflows/podcast-dotnet-maui-ci.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Binary file not shown.

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst;net6.0-windows10.0.19041</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<!-- iOS, Android, MacCatalyst -->
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Microsoft.NetConf2021.Maui</RootNamespace>
<UseMaui>true</UseMaui>
@ -15,7 +15,7 @@
<!-- App Identifier -->
<ApplicationId>com.Microsoft.NetConf2021.Maui</ApplicationId>
<ApplicationId Condition="$(TargetFramework.Contains('-windows'))">9C8A8C29-3AB6-4DD4-854C-313F379ABF70</ApplicationId>
<ApplicationIdGuid>9C8A8C29-3AB6-4DD4-854C-313F379ABF70</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
@ -24,25 +24,35 @@
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
<!-- Support for iOS ARM64 devices -->
<PropertyGroup Condition="$(TargetFramework.Contains('-ios'))">
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) and '$(Configuration)' == 'Release'">
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
<AppxPackageSigningEnabled>False</AppxPackageSigningEnabled>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
<CodesignEntitlement>Entitlements.plist</CodesignEntitlement>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Debug'">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiImage Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" IsAppIcon="true" Color="#C00CC0" />
<MauiIcon Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" Color="#C00CC0" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\splash.svg" Color="#C00CC0" />
<MauiSplashScreen Include="Resources\splash.svg" Color="#C00CC0" BaseSize="128,128"/>
<!-- Images -->
<MauiImage Include="Resources\Images\*" />