diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6766f41..a3be585 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,11 @@ jobs: dotnet-version: 8.x # Loop through all the solutions in src and restore, build & test + # Skip DocFxCompanionTools.sln, as it is a combination of all solutions. - name: Restore, build & test shell: pwsh run: | - foreach ($sln in (Get-ChildItem -Recurse src\*.sln)) { + foreach ($sln in (Get-ChildItem -Recurse src\*.sln -Exclude DocFxCompanionTools.sln)) { Write-Host "Start building $($sln.FullName)" & dotnet restore $sln.FullName diff --git a/.github/workflows/release-and-publish.yml b/.github/workflows/release-and-publish.yml index f4d0925..62d2353 100644 --- a/.github/workflows/release-and-publish.yml +++ b/.github/workflows/release-and-publish.yml @@ -8,30 +8,32 @@ on: jobs: build: runs-on: windows-latest - steps: - # Checkout sources. Depth=0 is for using GitVersion + steps: + # Checkout sources. Depth=0 is for using GitVersion - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: fetch-depth: 0 - # Install and Setup GitVersion + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x + + # Install and Setup GitVersion - name: Install GitVersion uses: gittools/actions/gitversion/setup@v3.0.0 with: - versionSpec: '6.x' - - name: Use GitVersion + versionSpec: '5.x' + # Step id is used as reference for the output values + - name: Use GitVersion to determine the version id: gitversion uses: gittools/actions/gitversion/execute@v3.0.0 - - # Setup .NET 8 - - name: Setup .NET - uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x - + useConfigFile: true + # Build the tools & create the zip-file and nuget packages # Chocolatey tools are in .\tools. NuGet packages in .\artifacts - name: Build & Package @@ -74,4 +76,5 @@ jobs: run: | foreach($file in (Get-ChildItem "./artifacts" -Recurse -Include *.nupkg)) { dotnet nuget push $file --api-key "${{ secrets.NUGET_TOOLS }}" --source https://api.nuget.org/v3/index.json --skip-duplicate - } \ No newline at end of file + } + diff --git a/build.ps1 b/build.ps1 index 839f0d7..f567e3f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -14,8 +14,8 @@ if (Test-Path -Path $solution.assetZipPath) { Remove-Item $solution.assetZipPath } -# Build all dotnet solution into $solution.targetFolder as single exe's -foreach ($sln in (Get-ChildItem -Recurse src\*.sln)) { +# Build all dotnet projects into $solution.targetFolder as single exe's. Skip Test projects. +foreach ($sln in (Get-ChildItem -Recurse src\*\*.csproj -Exclude *.Test.*)) { Write-Host "Start building $($sln.FullName)" & dotnet publish $sln.FullName -c Release -r win-x64 /p:PublishSingleFile=true /p:CopyOutputSymbolsToPublishDirectory=false --self-contained false -o $solution.targetFolder }