From 9d4debb211160ad67d50e73c33d5768f89802fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Barrera?= Date: Mon, 16 May 2022 10:58:12 +0200 Subject: [PATCH] use template workflow for ci --- .../podcast-dotnet-maui-blazor-ci.yml | 28 +++----------- .github/workflows/podcast-dotnet-maui-ci.yml | 34 +++-------------- .github/workflows/template-dotnet-maui-ci.yml | 38 +++++++++++++++++++ 3 files changed, 48 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/template-dotnet-maui-ci.yml diff --git a/.github/workflows/podcast-dotnet-maui-blazor-ci.yml b/.github/workflows/podcast-dotnet-maui-blazor-ci.yml index 855156b..aeaa12e 100644 --- a/.github/workflows/podcast-dotnet-maui-blazor-ci.yml +++ b/.github/workflows/podcast-dotnet-maui-blazor-ci.yml @@ -8,6 +8,7 @@ on: - 'src/Web/Components/**' - '**/*build.props' - '.github/workflows/podcast-dotnet-maui-blazor-ci.yml' + - '.github/workflows/template-dotnet-maui-ci.yml' pull_request: branches: - '**' @@ -16,32 +17,13 @@ on: - 'src/Web/Components/**' - '**/*build.props' - '.github/workflows/podcast-dotnet-maui-blazor-ci.yml' + - '.github/workflows/template-dotnet-maui-ci.yml' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: build-mobile: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install .NET 6 - shell: pwsh - run: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 - .\dotnet-install.ps1 -Channel 6.0.3xx -Quality daily -InstallDir . - - - name: Install MAUI workload - shell: pwsh - run: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://raw.githubusercontent.com/dotnet/maui/main/NuGet.config -OutFile maui-main-NuGet.config - & .\dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/main.json --configfile maui-main-NuGet.config - - - name: Build MAUI Blazor Mobile app - shell: pwsh - run: | - & .\dotnet build src/MobileBlazor/mauiapp/NetPodsMauiBlazor.csproj -bl:mobile.binlog \ No newline at end of file + uses: ./.github/workflows/template-dotnet-maui-ci.yml + with: + csproj: src/MobileBlazor/mauiapp/NetPodsMauiBlazor.csproj \ No newline at end of file diff --git a/.github/workflows/podcast-dotnet-maui-ci.yml b/.github/workflows/podcast-dotnet-maui-ci.yml index 7273134..9d3fcd6 100644 --- a/.github/workflows/podcast-dotnet-maui-ci.yml +++ b/.github/workflows/podcast-dotnet-maui-ci.yml @@ -8,6 +8,7 @@ on: - 'src/Web/Components/**' - '**/*build.props' - '.github/workflows/podcast-dotnet-maui-ci.yml' + - '.github/workflows/template-dotnet-maui-ci.yml' pull_request: branches: - '**' @@ -16,38 +17,13 @@ on: - 'src/Web/Components/**' - '**/*build.props' - '.github/workflows/podcast-dotnet-maui-ci.yml' + - '.github/workflows/template-dotnet-maui-ci.yml' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: build-mobile: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install .NET 6 - shell: pwsh - run: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 - .\dotnet-install.ps1 -Channel 6.0.3xx -Quality daily -InstallDir . - - - name: Install MAUI workload - shell: pwsh - run: | - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest https://raw.githubusercontent.com/dotnet/maui/main/NuGet.config -OutFile maui-main-NuGet.config - & .\dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/main.json --configfile maui-main-NuGet.config - - - name: Build MAUI Mobile app - shell: pwsh - run: | - & .\dotnet build src/Mobile/Microsoft.NetConf2021.Maui.csproj -bl:mobile.binlog - - - name: Archive build log - uses: actions/upload-artifact@v2 - with: - name: logs - path: '*.binlog' + uses: ./.github/workflows/template-dotnet-maui-ci.yml + with: + csproj: src/Mobile/Microsoft.NetConf2021.Maui.csproj \ No newline at end of file diff --git a/.github/workflows/template-dotnet-maui-ci.yml b/.github/workflows/template-dotnet-maui-ci.yml new file mode 100644 index 0000000..cbd3a81 --- /dev/null +++ b/.github/workflows/template-dotnet-maui-ci.yml @@ -0,0 +1,38 @@ +on: + workflow_call: + inputs: + csproj: + required: true + type: string + +jobs: + build-mobile: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install .NET 6 + shell: pwsh + run: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 + .\dotnet-install.ps1 -Channel 6.0.3xx -Quality daily -InstallDir . + + - name: Install MAUI workload + shell: pwsh + run: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest https://raw.githubusercontent.com/dotnet/maui/main/NuGet.config -OutFile maui-main-NuGet.config + & .\dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/main.json --configfile maui-main-NuGet.config + + - name: Build MAUI Mobile app + shell: pwsh + run: | + & .\dotnet build ${{inputs.csproj}} -bl:mobile.binlog + + - name: Archive build log + uses: actions/upload-artifact@v2 + with: + name: logs + path: '*.binlog'