From 957253f4933100d66eb8575af0abebfbbe898e90 Mon Sep 17 00:00:00 2001 From: Christian Engelhardt Date: Mon, 15 Apr 2024 21:46:51 +0200 Subject: [PATCH] chore: reformat pipeline and project files --- .github/workflows/pipeline.yml | 35 +++++---- libNOM.map/libNOM.map.csproj | 1 + libNOM.test/libNOM.test.csproj | 131 +++++++++++++++++++++------------ 3 files changed, 105 insertions(+), 62 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 871150e..5281fd8 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -7,6 +7,10 @@ on: branches: [ master ] create: +env: + dotnet: 8.0.x + injection: ./libNOM.io/Properties/ + jobs: test: name: Test @@ -20,7 +24,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: ${{ env.dotnet }} dotnet-quality: ga - name: Checkout uses: actions/checkout@v4 @@ -39,7 +43,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: ${{ env.dotnet }} dotnet-quality: ga - name: Checkout uses: actions/checkout@v4 @@ -51,29 +55,30 @@ jobs: restore-keys: ${{ runner.os }}-nuget- - name: Pack run: dotnet pack libNOM.map --configuration Release - - name: Upload + - name: Upload (NuGet) uses: actions/upload-artifact@v4 with: name: NuGet - path: | - ./.github/changelogs/ - ./libNOM.map/bin/Release/libNOM.map.*nupkg + path: ./libNOM.map/bin/Release/libNOM.map.*nupkg + if-no-files-found: error + - name: Upload (Release) + if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged + uses: actions/upload-artifact@v4 + with: + name: Release + path: ./.github/changelogs/${{ github.ref_name }}.md if-no-files-found: error release: name: Release + if: ${{ startsWith(github.ref, 'refs/tags/') }} # only if tagged runs-on: ubuntu-latest - # Only if commit was tagged. - if: ${{ startsWith(github.ref, 'refs/tags/') }} needs: [test, build] steps: - name: Download uses: actions/download-artifact@v4 - with: - name: NuGet - name: Version - run: echo "nupkg_version=$((((Get-Item -Path ./libNOM.map/bin/Release/libNOM.map.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV + run: echo "nupkg_version=$((((Get-Item -Path ./NuGet/libNOM.map.*.nupkg).Name -split '\.',3)[2] -split '\.',-2)[0])" >> $env:GITHUB_ENV shell: pwsh - # Exit if version mismatch. - name: Mismatch if: ${{ github.ref_name != env.nupkg_version }} run: | @@ -82,7 +87,7 @@ jobs: - name: Create uses: softprops/action-gh-release@v2 with: - body_path: ./.github/changelogs/${{ github.ref_name }}.md - files: ./libNOM.map/bin/Release/libNOM.map.*nupkg + body_path: ./Release/${{ github.ref_name }}.md + files: ./NuGet/libNOM.map.*nupkg - name: Publish - run: dotnet nuget push ./libNOM.map/bin/Release/libNOM.map.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + run: dotnet nuget push ./NuGet/libNOM.map.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} diff --git a/libNOM.map/libNOM.map.csproj b/libNOM.map/libNOM.map.csproj index 7972706..380ef2c 100644 --- a/libNOM.map/libNOM.map.csproj +++ b/libNOM.map/libNOM.map.csproj @@ -17,6 +17,7 @@ 12.0 + True diff --git a/libNOM.test/libNOM.test.csproj b/libNOM.test/libNOM.test.csproj index 86ef0f6..697c666 100644 --- a/libNOM.test/libNOM.test.csproj +++ b/libNOM.test/libNOM.test.csproj @@ -1,51 +1,88 @@ - - - net6.0;net7.0;net8.0 - true - - - - - enable - enable - True - 12.0 - True - True - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - True - True - Resources.resx - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - + + + net6.0;net7.0;net8.0 + true + + + + + enable + + + + + enable + false + + + false + + + 12.0 + True + + + + True + False + + + True + False + + + True + False + + + True + False + + + True + False + + + True + False + + + + + True + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + +