Skip to content

Commit

Permalink
feat: add .NET 9 Support
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Mittelette <[email protected]>
  • Loading branch information
nathan-mittelette authored and nathanmittelette committed Nov 15, 2024
1 parent 3d71d1f commit 864914e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
8 changes: 6 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x
- name: Build
run: dotnet build /WarnAsError

Expand All @@ -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/[email protected]
- name: Setup dotnet 9
uses: actions/[email protected]
with:
dotnet-version: '9.x'
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- muhammad-sammy.csharp
2 changes: 1 addition & 1 deletion CycloneDX.Tests/CycloneDX.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion CycloneDX/CycloneDX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ToolCommandName>dotnet-CycloneDX</ToolCommandName>
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(OsEnvironment )'=='windows'">
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion semver.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.1.0

0 comments on commit 864914e

Please sign in to comment.