From 864914eb936e02cf44a1bf754148f49974865291 Mon Sep 17 00:00:00 2001 From: Nathan Mittelette Date: Fri, 15 Nov 2024 11:25:00 +0100 Subject: [PATCH] feat: add .NET 9 Support Signed-off-by: Nathan Mittelette --- .devcontainer/Ubuntu22.04/Dockerfile | 2 +- .github/workflows/dotnetcore.yml | 8 ++++++-- .github/workflows/release.yml | 8 ++++---- .gitpod.yml | 3 ++- CycloneDX.Tests/CycloneDX.Tests.csproj | 2 +- CycloneDX/CycloneDX.csproj | 2 +- Dockerfile | 2 +- README.md | 1 + semver.txt | 2 +- 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.devcontainer/Ubuntu22.04/Dockerfile b/.devcontainer/Ubuntu22.04/Dockerfile index b52d8ecd..0ccfd4cb 100644 --- a/.devcontainer/Ubuntu22.04/Dockerfile +++ b/.devcontainer/Ubuntu22.04/Dockerfile @@ -4,5 +4,5 @@ RUN apt-get install -y --no-install-recommends wget=2.0.1 RUN apt-get install -y --no-install-recommends apt-transport-https=2.5.6 RUN curl -o ./packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb RUN dpkg -i packages-microsoft-prod.deb -RUN apt-get install -y --no-install-recommends dotnet-sdk-8.0=8.0 +RUN apt-get install -y --no-install-recommends dotnet-sdk-9.0=9.0 RUN rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index a082c0e4..534a2ddf 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 8.x + 9.x - name: Build run: dotnet build /WarnAsError @@ -43,11 +43,15 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - framework: ['net6.0','net7.0', 'net8.0'] + framework: ['net6.0','net7.0', 'net8.0', 'net9.0'] timeout-minutes: 30 steps: - uses: actions/checkout@v4.1.2 + - name: Setup dotnet 9 + uses: actions/setup-dotnet@v3.0.3 + with: + dotnet-version: '9.x' - name: Setup dotnet 8 uses: actions/setup-dotnet@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b90e6464..e1cb9fb3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,11 +33,11 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: | - 8.x + 9.x # The tests should have already been run during the PR workflow, so this is really just a sanity check - name: Tests - run: dotnet test --framework net8.0 + run: dotnet test --framework net9.0 # Build and package everything, including the Docker image - name: Package release @@ -66,8 +66,8 @@ jobs: # Generate the JSON with the docker container as additional smoke test - name: Generate JSON SBOM - run: docker run --rm -v ${GITHUB_WORKSPACE}:/usr/src/project cyclonedx/cyclonedx-dotnet:${{ steps.package_release.outputs.version }} /usr/src/project/CycloneDX.sln -j -o /usr/src/project - + run: docker run --rm -v ${GITHUB_WORKSPACE}:/usr/src/project cyclonedx/cyclonedx-dotnet:${{ steps.package_release.outputs.version }} /usr/src/project/CycloneDX.sln -j -o /usr/src/project + - name: Publish package to NuGet env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/.gitpod.yml b/.gitpod.yml index 2aed0c42..3ad7aad5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -11,9 +11,10 @@ tasks: "$DOTNET_ROOT/dotnet-install.sh" --channel 6.0 --install-dir "$DOTNET_ROOT" "$DOTNET_ROOT/dotnet-install.sh" --channel 7.0 --install-dir "$DOTNET_ROOT" "$DOTNET_ROOT/dotnet-install.sh" --channel 8.0 --install-dir "$DOTNET_ROOT" + "$DOTNET_ROOT/dotnet-install.sh" --channel 9.0 --install-dir "$DOTNET_ROOT" dotnet tool install --global dotnet-reportgenerator-globaltool dotnet restore vscode: extensions: - - muhammad-sammy.csharp \ No newline at end of file + - muhammad-sammy.csharp diff --git a/CycloneDX.Tests/CycloneDX.Tests.csproj b/CycloneDX.Tests/CycloneDX.Tests.csproj index 802f25da..6bd7738f 100644 --- a/CycloneDX.Tests/CycloneDX.Tests.csproj +++ b/CycloneDX.Tests/CycloneDX.Tests.csproj @@ -4,7 +4,7 @@ true false - net8.0;net7.0;net6.0 + net9.0;net8.0;net7.0;net6.0 latest diff --git a/CycloneDX/CycloneDX.csproj b/CycloneDX/CycloneDX.csproj index 1ae39c5b..6b1242ad 100644 --- a/CycloneDX/CycloneDX.csproj +++ b/CycloneDX/CycloneDX.csproj @@ -10,7 +10,7 @@ true dotnet-CycloneDX <_SkipUpgradeNetAnalyzersNuGetWarning>true - net8.0;net7.0;net6.0 + net9.0;net8.0;net7.0;net6.0 diff --git a/Dockerfile b/Dockerfile index ca7f1cec..21383d1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0.101 +FROM mcr.microsoft.com/dotnet/sdk:9.0 ARG VERSION COPY ./nupkgs /tmp/nupkgs/ diff --git a/README.md b/README.md index 8e03f2ed..ec95a65f 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ This module runs on * .NET 6.0 * .NET 7.0 * .NET 8.0 +* .NET 9.0 This module no longer runs on diff --git a/semver.txt b/semver.txt index fcdb2e10..ee74734a 100755 --- a/semver.txt +++ b/semver.txt @@ -1 +1 @@ -4.0.0 +4.1.0