Skip to content

Commit

Permalink
[IDP-2744] Fix auto-merge and nuget conflict (#128)
Browse files Browse the repository at this point in the history
* Update Build.ps1

* Update ci.yml

* Update .NET 6 to 8 + fix vulnerabilities

* Disable code analysis since less maintanable with multi framework

* Fix analyzer test

* pin ubuntu version

* Add error message
  • Loading branch information
PrincessMadMath authored Dec 18, 2024
1 parent 6e0cf48 commit 528fd49
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 14 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ on:
push:
branches:
- "renovate/**"


# Prevent duplicate runs if Renovate falls back to creating a PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
main:
runs-on: ubuntu-latest
# As of 18/12/2024, Ephemeral Mongo supports only MongoDB 6.0, which is compatible only with Ubuntu 22.04 (https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-ubuntu/)
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: "6.0.x"
source-url: ${{ secrets.NUGET_GSOFTDEV_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.GSOFT_NUGET_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Process {
Exec { & dotnet pack -c Release -o "$outputDir" }

if (($null -ne $env:NUGET_SOURCE ) -and ($null -ne $env:NUGET_API_KEY)) {
Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY }
Exec { & dotnet nuget push "$nupkgsPath" -s $env:NUGET_SOURCE -k $env:NUGET_API_KEY --skip-duplicate }
}
}
finally {
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.403",
"version": "8.0.404",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0;netstandard2.0</TargetFrameworks>
<IsPackable>True</IsPackable>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected BaseAnalyzerTest()
this.TestState.Sources.Add(CSharp10GlobalUsings);
this.TestState.Sources.Add(MongoGlobalUsings);

this.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net60;
this.TestState.ReferenceAssemblies = ReferenceAssemblies.Net.Net80;
this.TestState.AdditionalReferences.Add(typeof(IMongoDocument).Assembly); // Workleap.Extensions.Mongo
this.TestState.AdditionalReferences.Add(typeof(MongoClient).Assembly); // MongoDB.Driver
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -14,6 +14,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.Formats.Asn1" Version="9.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0;netstandard2.0</TargetFrameworks>
<IsPackable>True</IsPackable>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Workleap.Extensions.Xunit" Version="1.0.2" />
<PackageReference Include="Workleap.Extensions.Xunit" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
Expand Down
1 change: 1 addition & 0 deletions src/Workleap.Extensions.Mongo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{E16B8921
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
..\README.md = ..\README.md
..\global.json = ..\global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Workleap.Extensions.Mongo.Abstractions", "Workleap.Extensions.Mongo.Abstractions\Workleap.Extensions.Mongo.Abstractions.csproj", "{9F410354-6AEC-4A46-84B4-214076363660}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public CommandPerformanceAnalyzer(IMongoClient mongoClient, MongoCommandPerforma

public void AnalyzeCommand(CommandToAnalyze command)
{
#pragma warning disable CA1513 // Justification: Ensuring maintainability by using a common approach that supports multiple .NET frameworks
if (this._isDisposed)
{
throw new ObjectDisposedException(nameof(CommandPerformanceAnalyzer));
Expand All @@ -51,6 +52,7 @@ public void AnalyzeCommand(CommandToAnalyze command)

public void StartBackgroundTask()
{
#pragma warning disable CA1513 // Justification: Ensuring maintainability by using a common approach that supports multiple .NET frameworks
if (this._isDisposed)
{
throw new ObjectDisposedException(nameof(CommandPerformanceAnalyzer));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net6.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0;netstandard2.0</TargetFrameworks>
<IsPackable>True</IsPackable>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down

0 comments on commit 528fd49

Please sign in to comment.