diff --git a/.github/workflows/podcast-dotnet-maui-blazor-cd.yml b/.github/workflows/podcast-dotnet-maui-blazor-cd.yml new file mode 100644 index 0000000..013d27b --- /dev/null +++ b/.github/workflows/podcast-dotnet-maui-blazor-cd.yml @@ -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 diff --git a/.github/workflows/podcast-dotnet-maui-blazor.yml b/.github/workflows/podcast-dotnet-maui-blazor-ci.yml similarity index 82% rename from .github/workflows/podcast-dotnet-maui-blazor.yml rename to .github/workflows/podcast-dotnet-maui-blazor-ci.yml index 04dcaca..855156b 100644 --- a/.github/workflows/podcast-dotnet-maui-blazor.yml +++ b/.github/workflows/podcast-dotnet-maui-blazor-ci.yml @@ -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: diff --git a/.github/workflows/podcast-dotnet-maui-cd.yml b/.github/workflows/podcast-dotnet-maui-cd.yml new file mode 100644 index 0000000..f4901dd --- /dev/null +++ b/.github/workflows/podcast-dotnet-maui-cd.yml @@ -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 diff --git a/.github/workflows/podcast-dotnet-maui.yml b/.github/workflows/podcast-dotnet-maui-ci.yml similarity index 89% rename from .github/workflows/podcast-dotnet-maui.yml rename to .github/workflows/podcast-dotnet-maui-ci.yml index 405458e..7273134 100644 --- a/.github/workflows/podcast-dotnet-maui.yml +++ b/.github/workflows/podcast-dotnet-maui-ci.yml @@ -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: diff --git a/android-keystore-test.jks.gpg b/android-keystore-test.jks.gpg new file mode 100644 index 0000000..5d0792a Binary files /dev/null and b/android-keystore-test.jks.gpg differ diff --git a/src/Lib/SharedMauiLib/SharedMauiLib.csproj b/src/Lib/SharedMauiLib/SharedMauiLib.csproj index f6d3e2e..a30d7a0 100644 --- a/src/Lib/SharedMauiLib/SharedMauiLib.csproj +++ b/src/Lib/SharedMauiLib/SharedMauiLib.csproj @@ -1,8 +1,7 @@  - net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst - $(TargetFrameworks);net6.0-windows10.0.19041 + net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst;net6.0-windows10.0.19041 true true enable diff --git a/src/Mobile/Microsoft.NetConf2021.Maui.csproj b/src/Mobile/Microsoft.NetConf2021.Maui.csproj index 046afb4..76fe29c 100644 --- a/src/Mobile/Microsoft.NetConf2021.Maui.csproj +++ b/src/Mobile/Microsoft.NetConf2021.Maui.csproj @@ -3,7 +3,7 @@ net6.0-android;net6.0-ios;net6.0-maccatalyst - $(TargetFrameworks);net6.0-windows10.0.19041 + $(TargetFrameworks);net6.0-windows10.0.19041.0 Exe Microsoft.NetConf2021.Maui true @@ -15,7 +15,7 @@ com.Microsoft.NetConf2021.Maui - 9C8A8C29-3AB6-4DD4-854C-313F379ABF70 + 9C8A8C29-3AB6-4DD4-854C-313F379ABF70 1.0 @@ -24,25 +24,35 @@ True - 14.2 - 14.0 - 21.0 - 10.0.17763.0 + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 10.0.17763.0 - - + + true + False + + + + ios-arm64 + Entitlements.plist + + + ios-arm64 iossimulator-x64 - + - +