diff --git a/.github/workflows/build-maui-toolkit.yml b/.github/workflows/build-maui-toolkit.yml index 125b16e..2372463 100644 --- a/.github/workflows/build-maui-toolkit.yml +++ b/.github/workflows/build-maui-toolkit.yml @@ -9,7 +9,7 @@ on: # Allows you to run this workflow manually from the Actions tab env: - DOTNET_VERSION: '6.0.300' + DOTNET_VERSION: '6.0.x' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -31,17 +31,17 @@ jobs: uses: actions/setup-dotnet@v2 with: # Optional SDK version to use. If not provided, will install global.json version when available. Examples: 2.2.104, 3.1, 3.1.x - dotnet-version: ${{ env.DOTNET_VERSION }} + dotnet-version: ${{ secrets.DOTNET_VERSION }} # Whether prerelease versions should be matched with non-exact versions (for example 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not provided. include-prerelease: false # Install Maui workload - name: Install Maui workload - run: dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/6.0.300.json --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json + run: dotnet workload install maui --from-rollback-file https://aka.ms/dotnet/maui/${{ secrets.DOTNET_VERSION }}.json --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json # Install WebAssembly workload - name: Install WebAssembly workload - run: dotnet workload install wasm-tools --from-rollback-file https://aka.ms/dotnet/maui/6.0.300.json --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json + run: dotnet workload install wasm-tools --from-rollback-file https://aka.ms/dotnet/maui/${{ secrets.DOTNET_VERSION }}.json --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json # List installed workload - name: List installed workloads @@ -53,5 +53,16 @@ jobs: # Build the project in Release mode - name: Build the Solution in Release mode - shell: cmd - run: .\Create-Package.bat Release + run: .\Create-Package.bat ${{ secrets.BUILD_CONFIG }} ${{ secrets.MAUI_TOOLKIT_PKG_VERSION }} + + - name: Archive VijayAnand.MauiToolkit.Core NuGet package + uses: actions/upload-artifact@v3 + with: + name: archive-core-nuget-package + path: src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/bin/${{ secrets.BUILD_CONFIG }}/VijayAnand.MauiToolkit.Core.${{ secrets.MAUI_TOOLKIT_PKG_VERSION }}.nupkg + + - name: Archive VijayAnand.MauiToolkit NuGet package + uses: actions/upload-artifact@v3 + with: + name: archive-toolkit-nuget-package + path: src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit/bin/${{ secrets.BUILD_CONFIG }}/VijayAnand.MauiToolkit.${{ secrets.MAUI_TOOLKIT_PKG_VERSION }}.nupkg diff --git a/src/VijayAnand.MauiToolkit/Create-Package.bat b/src/VijayAnand.MauiToolkit/Create-Package.bat index cf1c8f0..41b3f2e 100644 --- a/src/VijayAnand.MauiToolkit/Create-Package.bat +++ b/src/VijayAnand.MauiToolkit/Create-Package.bat @@ -1,31 +1,34 @@ :: Creates a new NuGet package from the project file @echo off -if [%1]==[] (call Error "Build configuration input is not provided." & goto end) +if [%1]==[] (echo Build configuration input is not provided. & goto end) set config=%1 +if not [%2]==[] (set pkgVersion=%2) + :: Package Name -if not exist CorePackageName.txt (call Error "Core package name file not available." & goto end) +if not exist CorePackageName.txt (echo Core package name file not available. & goto end) set /P corePkgName=