Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to .NET 8.0 #1673

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .devcontainer/Dockerfile

This file was deleted.

6 changes: 6 additions & 0 deletions .devcontainer/container-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ sudo apt install python3-pip -y
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install wheel

# Install Python packages
pip install -r requirements-docs.txt

# Restore .NET packages
dotnet restore

# Install PowerShell dependencies
$ProgressPreference = [System.Management.Automation.ActionPreference]::SilentlyContinue;
if ($Null -eq (Get-PackageProvider -Name NuGet -ErrorAction Ignore)) {
Expand Down
23 changes: 11 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
"name": "PSRule dev",
"name": "PSRule development environment",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
"customizations": {
"vscode": {
"settings": {
Expand All @@ -23,20 +26,16 @@
}
},
"features": {
"ghcr.io/devcontainers/features/github-cli": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/powershell": {
"ghcr.io/devcontainers/features/powershell:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "latest"
}
},
"onCreateCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-build.ps1",
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "6.0-bullseye-slim"
}
},
"remoteUser": "vscode"
"postStartCommand": "/opt/microsoft/powershell/7/pwsh -f .devcontainer/container-start.ps1"
}
42 changes: 0 additions & 42 deletions .github/dependabot.yaml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Dependabot configuration
#

# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for NuGet
- package-ecosystem: nuget
directory: '/'
schedule:
interval: daily
labels:
- dependencies
reviewers:
- microsoft/psrule

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
labels:
- ci-quality
reviewers:
- microsoft/psrule

# Maintain dependencies for Python
- package-ecosystem: pip
directory: '/'
schedule:
interval: daily
labels:
- ci-quality
reviewers:
- microsoft/psrule

# Maintain dependencies for Dev Containers
- package-ecosystem: devcontainers
directory: '/'
schedule:
interval: weekly
labels:
- ci-quality
reviewers:
- microsoft/psrule
2 changes: 1 addition & 1 deletion .github/workflows/analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'csharp'
languages: csharp

- name: Autobuild
uses: github/codeql-action/autobuild@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x

- name: Install dependencies
shell: pwsh
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x

- if: ${{ matrix.shell == 'pwsh' }}
name: Install dependencies (PowerShell)
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers

What's changed since pre-release v3.0.0-B0141:

- Engineering:
- **Breaking change:** Bump development tools to .NET 8.0 SDK by @BernieWhite.
[#1673](https://github.com/microsoft/PSRule/pull/1673)
- Running PSRule from PowerShell 7.x is supported on 7.4 and above.
- Running PSRule from Windows PowerShell 5.1 is still supported but deprecated and will be removed in PSRule v4.
- Bug fixes:
- Fixed CLI null reference when include module is undefined by @BernieWhite.
[#1746](https://github.com/microsoft/PSRule/issues/1746)
Expand Down
14 changes: 7 additions & 7 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ version: 2
updates:

# Maintain GitHub Actions
- package-ecosystem: "github-actions"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "daily"
interval: daily
```

[7]: https://docs.github.com/code-security/dependabot/working-with-dependabot
Expand Down Expand Up @@ -90,12 +90,12 @@ You can also use this option to install on CI workers that are not natively supp
The following platforms are supported:

- Windows PowerShell 5.1 with .NET Framework 4.7.2 or greater.
- PowerShell 7.3 or greater on MacOS, Linux, and Windows.
- PowerShell 7.4 or greater on MacOS, Linux, and Windows.

### Installing PowerShell

PowerShell 7.x can be installed on MacOS, Linux, and Windows but is not installed by default.
For a list of platforms that PowerShell 7.3 is supported on and install instructions see [Get PowerShell][3].
For a list of platforms that PowerShell 7.4 is supported on and install instructions see [Get PowerShell][3].

!!! Note
If you are using Windows PowerShell you may need to bootstrap NuGet before you can install modules.
Expand Down Expand Up @@ -198,9 +198,9 @@ The following PowerShell modules will be automatically install if the required v

These additional modules are only required for building PSRule.

Additionally .NET SDK v7 is required.
Additionally .NET SDK v8 is required.
.NET will not be automatically downloaded and installed.
To download and install the latest SDK see [Download .NET 7.0][dotnet].
To download and install the latest SDK see [Download .NET 8.0][dotnet].

### Limited access networks

Expand Down Expand Up @@ -242,4 +242,4 @@ After downloading the modules, copy the module directories to devices with restr
*[CI]: continuous integration

[module]: https://www.powershellgallery.com/packages/PSRule
[dotnet]: https://dotnet.microsoft.com/download/dotnet/7.0
[dotnet]: https://dotnet.microsoft.com/download/dotnet/8.0
4 changes: 2 additions & 2 deletions pipeline.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ task BuildDotNet {
}
exec {
# Build library
dotnet build src/PSRule.Tool -c $Configuration -f net7.0 -p:version=$Build
dotnet build src/PSRule.Tool -c $Configuration -f net8.0 -p:version=$Build
dotnet build src/PSRule.SDK -c $Configuration -f netstandard2.0 -p:version=$Build
dotnet publish src/PSRule -c $Configuration -f netstandard2.0 -o $(Join-Path -Path $PWD -ChildPath out/modules/PSRule) -p:version=$Build
}
Expand Down Expand Up @@ -327,7 +327,7 @@ task Rules {

task Benchmark {
if ($Benchmark -or $BuildTask -eq 'Benchmark') {
dotnet run --project src/PSRule.Benchmark -f net7.0 -c Release -- benchmark --output $PWD;
dotnet run --project src/PSRule.Benchmark -f net8.0 -c Release -- benchmark --output $PWD;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/PSRule.Benchmark/PSRule.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\PSRule.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<ProjectGuid>{3ec0912f-bfc7-4b53-a1a1-0ba993c6282e}</ProjectGuid>
<EnableNuget>false</EnableNuget>
Expand All @@ -23,8 +23,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.3.7" />
<PackageReference Include="System.Management.Automation" Version="7.3.7" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.1" />
<PackageReference Include="System.Management.Automation" Version="7.4.1" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>

Expand Down
Loading
Loading