From 573f52eba0f42f60b2808506b434622cec50cb62 Mon Sep 17 00:00:00 2001 From: Lexy Zhitenev Date: Fri, 28 Feb 2025 13:24:53 +1000 Subject: [PATCH 1/2] Quick'n'dirty net8 --- .github/workflows/action.yml | 18 ++---------- .github/workflows/release.yml | 28 +++---------------- Dockerfile | 6 ++-- src/LicenseToUrlMappings.cs | 1 - src/NugetUtility.csproj | 6 ++-- .../NugetUtility.Tests.csproj | 2 +- 6 files changed, 13 insertions(+), 48 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index bbe5e217..33172d42 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -12,24 +12,10 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - name: Setup dotnet 3.0.100 + - name: Setup dotnet 8.x uses: actions/setup-dotnet@v2 with: - dotnet-version: "3.1.100" # SDK Version to use. - - name: Setup dotnet 5.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "5.0.x" # SDK Version to use (x uses the latest version). - - name: Setup dotnet 6.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "6.0.x" # SDK Version to use (x uses the latest version). - - name: Setup dotnet 7.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "7.0.x" # SDK Version to use (x uses the latest version). + dotnet-version: "8.x" # SDK Version to use (x uses the latest version). # dotnet restore - name: restore run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b5ce46c..98946d0c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,30 +12,10 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - name: Setup dotnet 3.0.100 + - name: Setup dotnet 8.x uses: actions/setup-dotnet@v2 with: - dotnet-version: "3.1.100" # SDK Version to use. - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Setup dotnet 5.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "5.0.x" # SDK Version to use (x uses the latest version). - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Setup dotnet 6.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "6.0.x" # SDK Version to use (x uses the latest version). - env: - NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Setup dotnet 7.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: "7.0.103" # SDK Version to use (x uses the latest version). + dotnet-version: "8.x" # SDK Version to use (x uses the latest version). env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} # dotnet restore @@ -52,10 +32,10 @@ jobs: run: dotnet pack --configuration Release # publish the package - name: Publish the artifact - run: dotnet publish -f net7.0 -c Release -o ./artifacts + run: dotnet publish -f net8.0 -c Release -o ./artifacts # publish the package to package folder - name: Publish the artifact - run: dotnet publish -f net7.0 -c Release -o ./package + run: dotnet publish -f net8.0 -c Release -o ./package # Add nuget package - name: Nuget package run: dotnet pack -c Release -o ./artifacts diff --git a/Dockerfile b/Dockerfile index c94f6c07..5faaabd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /src @@ -7,10 +7,10 @@ RUN dotnet restore COPY . ./ -RUN dotnet publish -f net7.0 -c Release -o out +RUN dotnet publish -f net8.0 -c Release -o out -FROM mcr.microsoft.com/dotnet/runtime:7.0 +FROM mcr.microsoft.com/dotnet/runtime:8.0 WORKDIR /src COPY --from=build-env /src/out . ENTRYPOINT ["dotnet", "NugetUtility.dll"] diff --git a/src/LicenseToUrlMappings.cs b/src/LicenseToUrlMappings.cs index d88f77c1..18d535eb 100644 --- a/src/LicenseToUrlMappings.cs +++ b/src/LicenseToUrlMappings.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using System.Diagnostics.CodeAnalysis; namespace NugetUtility { diff --git a/src/NugetUtility.csproj b/src/NugetUtility.csproj index 20326d46..d84675d1 100644 --- a/src/NugetUtility.csproj +++ b/src/NugetUtility.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;net5.0;net6.0;net7.0 + net8.0 false latest false @@ -12,8 +12,8 @@ git dotnet-project-licenses dotnet-project-licenses - 2.7.1 - Tom Chavakis, Lexy2, senslen + 2.7.2 + Tom Chavakis, Lexy2, sensslen - .NET Core Tool to print a list of the licenses of a projects https://github.com/tomchavakis/nuget-license diff --git a/tests/NugetUtility.Tests/NugetUtility.Tests.csproj b/tests/NugetUtility.Tests/NugetUtility.Tests.csproj index 0d730709..d68e61dc 100644 --- a/tests/NugetUtility.Tests/NugetUtility.Tests.csproj +++ b/tests/NugetUtility.Tests/NugetUtility.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1;net5.0;net6.0;net7.0; + net8.0; false false latest From 8795f8c124889887b1a2c1b2470978e46550c612 Mon Sep 17 00:00:00 2001 From: Lexy Zhitenev Date: Fri, 28 Feb 2025 13:28:12 +1000 Subject: [PATCH 2/2] Returned accidentally removed checkouts --- .github/workflows/action.yml | 3 ++- .github/workflows/release.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 33172d42..e4e54fb0 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -12,8 +12,9 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: + - uses: actions/checkout@v4 - name: Setup dotnet 8.x - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: "8.x" # SDK Version to use (x uses the latest version). # dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98946d0c..06107227 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,9 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Setup dotnet 8.x - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: "8.x" # SDK Version to use (x uses the latest version). env: