Skip to content
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: 5 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
uses: actions/setup-dotnet@v5
- name: Restore dependencies
run: dotnet restore $solution
- name: Build
run: dotnet build $solution --no-restore
- name: Test
run: dotnet test $solution --no-build --verbosity normal
run: dotnet test $solution --verbosity normal
- name: Pack
run: dotnet pack $solution --no-build --include-source --output pkgs
run: dotnet pack $solution --output pkgs
- name: Upload Package as a Build Artifact
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v7
with:
Comment thread
grimley517 marked this conversation as resolved.
name: package
path: pkgs
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
create_nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

Comment thread
grimley517 marked this conversation as resolved.
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack $PROJECT --configuration Release --output ${{ env.NuGetDirectory }}

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
Comment thread
grimley517 marked this conversation as resolved.
name: nuget
if-no-files-found: error
Expand All @@ -36,10 +36,10 @@ jobs:
steps:
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:
Comment on lines 37 to 43

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several run: steps in this workflow use PowerShell syntax (e.g., Get-ChildItem, foreach(...)), but the jobs run on ubuntu-latest and these steps don’t set shell: pwsh. Unless the shell is set, these commands will execute under bash and fail. Set defaults.run.shell: pwsh for the workflow/job, or rewrite those commands to bash equivalents.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 91d7cff. Converted both PowerShell steps to bash equivalents: replaced (Get-ChildItem ...) with $(ls ...) for the validate step, and replaced the foreach(...) loop with a bash for ... do ... done loop (with the path properly quoted) for the publish step.

name: nuget
path: ${{ env.NuGetDirectory }}
Expand All @@ -52,14 +52,14 @@ jobs:
# If some rules are not applicable, you can disable them
# using the --excluded-rules or --excluded-rule-ids option
- name: Validate package
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
run: meziantou.validate-nuget-package $(ls ${{ env.NuGetDirectory }}/*.nupkg)

run_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
- name: Run tests
run: dotnet test $PROJECT --configuration Release

Expand All @@ -72,20 +72,20 @@ jobs:
needs: [ validate_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:
name: nuget
path: ${{ env.NuGetDirectory }}

# Install the .NET SDK indicated in the global.json file
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5

# Publish all NuGet packages to NuGet.org
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet package
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_TOKEN }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
for file in "${{ env.NuGetDirectory }}"/*.nupkg; do
dotnet nuget push "$file" --api-key "${{ secrets.NUGET_TOKEN }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
done
55 changes: 0 additions & 55 deletions .github/workflows/sonar.yml

This file was deleted.

6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.projectKey=grimley517_DecimalToSqlChecker
sonar.organization=grimley517
sonar.host.url=https://sonarcloud.io
sonar.cs.opencover.reportsPaths=coverage.xml
1 change: 0 additions & 1 deletion src/DecimalChecker.Tests/DecimalChecker.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
1 change: 0 additions & 1 deletion src/DecimalChecker/DecimalChecker.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackOnBuild>true</PackOnBuild>
Expand Down
5 changes: 5 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
</Project>
Loading