From 21562a3e48bd90891e3eab48c7b0ddcea064e309 Mon Sep 17 00:00:00 2001 From: Mathieu Gamache Date: Tue, 17 Dec 2024 17:32:06 -0500 Subject: [PATCH] [IDP-2744] Fix auto-merge and nuget conflict (#99) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Build.ps1 * Update ci.yml * Update CI.yml to use dotnet version global.json + publish temp version * Target framework 8 instead of 6 * Try debug build.ps1 * Trying something * Use windows instead * Remove logging * Update CI workflow to run on Windows for .NET Framework 4.6.2 support * Trying alternative * Try condition for os * Update Build.ps1 Co-authored-by: Gérald Barré --------- Co-authored-by: Gérald Barré --- .github/workflows/ci.yml | 29 ++++++++++++++++--- Build.ps1 | 4 +-- ...omponentModel.DataAnnotations.Tests.csproj | 3 +- ...leap.ComponentModel.DataAnnotations.csproj | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d84fba..680ce31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,15 +2,24 @@ name: CI on: pull_request: - branches: ["main"] + branches: ["main", "master"] + paths-ignore: ["*.md"] push: branches: - "renovate/**" +# Prevent duplicate runs if Renovate falls back to creating a PR +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + jobs: - main: - runs-on: ubuntu-latest + ci: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -19,7 +28,19 @@ jobs: - uses: actions/setup-dotnet@v4 with: - global-json-file: "global.json" + source-url: ${{ secrets.NUGET_GSOFTDEV_FEED_URL }} + env: + NUGET_AUTH_TOKEN: ${{ secrets.GSOFT_NUGET_API_KEY }} - run: ./Build.ps1 shell: pwsh + env: + NUGET_SOURCE: ${{ secrets.NUGET_GSOFTDEV_FEED_URL }} + NUGET_API_KEY: ${{ secrets.GSOFT_NUGET_API_KEY }} + + linearb: + needs: [ci] + uses: gsoft-inc/wl-reusable-workflows/.github/workflows/linearb-deployment.yml@main + with: + environment: development + secrets: inherit diff --git a/Build.ps1 b/Build.ps1 index 7185a99..977cf22 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -25,8 +25,8 @@ Process { Exec { & dotnet test -c Release --no-build --results-directory "$outputDir" --no-restore -l "trx" -l "console;verbosity=detailed" } Exec { & dotnet pack -c Release --no-build -o "$outputDir" } - if (($null -ne $env:NUGET_SOURCE ) -and ($null -ne $env:NUGET_API_KEY)) { - Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY } + if (($null -ne $env:NUGET_SOURCE) -and ($null -ne $env:NUGET_API_KEY) -and ($IsLinux)) { + Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY --skip-duplicate } } } finally { diff --git a/src/Workleap.ComponentModel.DataAnnotations.Tests/Workleap.ComponentModel.DataAnnotations.Tests.csproj b/src/Workleap.ComponentModel.DataAnnotations.Tests/Workleap.ComponentModel.DataAnnotations.Tests.csproj index ed8cfbf..e5385d9 100644 --- a/src/Workleap.ComponentModel.DataAnnotations.Tests/Workleap.ComponentModel.DataAnnotations.Tests.csproj +++ b/src/Workleap.ComponentModel.DataAnnotations.Tests/Workleap.ComponentModel.DataAnnotations.Tests.csproj @@ -1,6 +1,7 @@ - net462;net6.0 + net8.0 + $(TargetFramework);net462 false true true diff --git a/src/Workleap.ComponentModel.DataAnnotations/Workleap.ComponentModel.DataAnnotations.csproj b/src/Workleap.ComponentModel.DataAnnotations/Workleap.ComponentModel.DataAnnotations.csproj index 31f44d4..1b283a2 100644 --- a/src/Workleap.ComponentModel.DataAnnotations/Workleap.ComponentModel.DataAnnotations.csproj +++ b/src/Workleap.ComponentModel.DataAnnotations/Workleap.ComponentModel.DataAnnotations.csproj @@ -1,6 +1,6 @@ - net462;net6.0;netstandard2.0 + net462;net8.0;netstandard2.0 True True snupkg