Skip to content

Commit ac05ea4

Browse files
committed
target frameworks: netstandard2.0;net6.0;net8.0
1 parent 72bbf4b commit ac05ea4

File tree

8 files changed

+46
-35
lines changed

8 files changed

+46
-35
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
with:
3939
dotnet-version: |
4040
6.0.x
41-
9.0.x
41+
8.0.x
4242
4343
- name: Install GitVersion
4444
uses: gittools/actions/gitversion/setup@v1
@@ -154,4 +154,15 @@ jobs:
154154
run: |
155155
echo "Publishing NuGet packages with version: ${{ steps.gitversion.outputs.NuGetVersion }}"
156156
dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
157-
continue-on-error: ${{ steps.detect-env.outputs.running_in_act == 'true' }}
157+
continue-on-error: ${{ steps.detect-env.outputs.running_in_act == 'true' }}
158+
159+
- name: Create and push Git tag for release
160+
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && steps.detect-env.outputs.running_in_act != 'true'
161+
run: |
162+
echo "Creating Git tag for version: ${{ steps.gitversion.outputs.NuGetVersion }}"
163+
git config --global user.name "GitHub Actions"
164+
git config --global user.email "[email protected]"
165+
git tag ${{ steps.gitversion.outputs.NuGetVersion }}
166+
git push origin ${{ steps.gitversion.outputs.NuGetVersion }}
167+
env:
168+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"tasks": [
66
{
77
"label": "build",
8-
"command": "dotnet build -f net9.0",
8+
"command": "dotnet build -f net8.0",
99
"type": "shell",
1010
"group": {
1111
"kind": "build",

Ductus.FluentDocker.MsTest/Ductus.FluentDocker.MsTest.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
55
<Version>1.0.0</Version>
66
<AssemblyVersion>1.0.0.0</AssemblyVersion>
77
<FileVersion>1.0.0.0</FileVersion>
@@ -22,7 +22,7 @@
2222
Ms Test Support to allow for create, run one or more docker images while testing using docker, compose, machine (Linux, Windows, Mac) using netcore or full framework.
2323
Documentation: https://github.com/mariotoffia/FluentDocker
2424
</Description>
25-
<Copyright>© 2016 - 2021 Mario Toffia</Copyright>
25+
<Copyright>© 2016 - 2025 Mario Toffia</Copyright>
2626
<AssemblyOriginatorKeyFile>..\keypair.snk</AssemblyOriginatorKeyFile>
2727
<SignAssembly>true</SignAssembly>
2828
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
@@ -38,10 +38,13 @@ Documentation: https://github.com/mariotoffia/FluentDocker
3838
</ItemGroup>
3939

4040
<ItemGroup>
41-
<PackageReference Include="MSTest.TestFramework" Version="1.1.17" />
41+
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
4242
</ItemGroup>
4343
<ItemGroup>
4444
<ProjectReference Include="..\Ductus.FluentDocker\Ductus.FluentDocker.csproj" />
4545
</ItemGroup>
46-
46+
47+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
48+
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
49+
</ItemGroup>
4750
</Project>

Ductus.FluentDocker.Tests/Ductus.FluentDocker.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

Ductus.FluentDocker.XUnit/Ductus.FluentDocker.XUnit.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
44
<Version>1.0.0</Version>
55
<AssemblyVersion>1.0.0.0</AssemblyVersion>
66
<FileVersion>1.0.0.0</FileVersion>
@@ -21,7 +21,7 @@
2121
XUnit Support to allow for create, run one or more docker images while testing using docker, compose, machine (Linux, Windows, Mac) using netcore or full framework.
2222
Documentation: https://github.com/mariotoffia/FluentDocker
2323
</Description>
24-
<Copyright>© 2016 - 2021 Mario Toffia</Copyright>
24+
<Copyright>© 2016 - 2025 Mario Toffia</Copyright>
2525
<AssemblyOriginatorKeyFile>..\keypair.snk</AssemblyOriginatorKeyFile>
2626
<SignAssembly>true</SignAssembly>
2727
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
@@ -39,4 +39,8 @@
3939
<ItemGroup>
4040
<ProjectReference Include="..\Ductus.FluentDocker\Ductus.FluentDocker.csproj" />
4141
</ItemGroup>
42+
43+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
44+
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
45+
</ItemGroup>
4246
</Project>

Ductus.FluentDocker/Ductus.FluentDocker.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
44
<Version>1.0.0</Version>
55
<AssemblyVersion>1.0.0.0</AssemblyVersion>
66
<FileVersion>1.0.0.0</FileVersion>
@@ -21,7 +21,7 @@
2121
<RepositoryType>git</RepositoryType>
2222
<RepositoryUrl>https://github.com/mariotoffia/FluentDocker</RepositoryUrl>
2323
<Description>Library to manage docker-machine, docker-compose, and docker containers for windows / mac or native linux using netcore or full framework.</Description>
24-
<Copyright>© 2016 - 2021 Mario Toffia</Copyright>
24+
<Copyright>© 2016 - 2025 Mario Toffia</Copyright>
2525
<AssemblyOriginatorKeyFile>..\keypair.snk</AssemblyOriginatorKeyFile>
2626
<SignAssembly>true</SignAssembly>
2727
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
@@ -42,8 +42,8 @@
4242
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
4343
<PackageReference Include="SharpCompress" Version="0.29.0" />
4444
</ItemGroup>
45-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
46-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
45+
46+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
4747
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
4848
</ItemGroup>
4949
</Project>

Ductus.FluentDocker/Extensions/Utils/DockerBinariesResolver.cs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public DockerBinariesResolver(SudoMechanism sudo, string password, params string
4848
public DockerBinary MainDockerCompose { get; }
4949
public DockerBinary MainDockerMachine { get; }
5050
public DockerBinary MainDockerCli { get; }
51+
public bool IsDockerClientAvailable => null != MainDockerClient;
52+
public bool IsDockerComposeAvailable => null != MainDockerCompose;
53+
public bool IsDockerMachineAvailable => null != MainDockerMachine;
5154
public bool HasToolbox { get; }
5255

5356
public DockerBinary Resolve(string binary, bool preferMachine = false)
@@ -62,25 +65,15 @@ public DockerBinary Resolve(string binary, bool preferMachine = false)
6265
}
6366
}
6467

65-
DockerBinary resolved = null;
66-
switch (type)
68+
var resolved = type switch
6769
{
68-
case DockerBinaryType.Compose:
69-
resolved = MainDockerCompose;
70-
break;
71-
case DockerBinaryType.DockerClient:
72-
resolved = MainDockerClient;
73-
break;
74-
case DockerBinaryType.Machine:
75-
resolved = MainDockerMachine;
76-
break;
77-
case DockerBinaryType.Cli:
78-
resolved = MainDockerCli;
79-
break;
80-
default:
81-
throw new FluentDockerException($"Cannot resolve unknown binary {binary}");
82-
}
83-
70+
DockerBinaryType.Compose => MainDockerCompose,
71+
DockerBinaryType.DockerClient => MainDockerClient,
72+
DockerBinaryType.Machine => MainDockerMachine,
73+
DockerBinaryType.Cli => MainDockerCli,
74+
_ => throw new FluentDockerException($"Cannot resolve unknown binary {binary}"),
75+
};
76+
8477
if (null == resolved)
8578
{
8679
throw new FluentDockerException($"Could not resolve binary {binary} is it installed on the local system?");

GitVersion.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
mode: Mainline
2-
next-version: 2.0.0 # Set your current major version here
2+
next-version: 2.10.60 # Set to a higher version to ensure proper calculation
33
major-version-bump-message: '\+semver:\s?(breaking|major)'
44
minor-version-bump-message: '\+semver:\s?(feature|minor)'
55
patch-version-bump-message: '\+semver:\s?(fix|patch)'
66
no-bump-message: '\+semver:\s?(none|skip)'
77
assembly-versioning-scheme: MajorMinorPatch
88
assembly-file-versioning-scheme: MajorMinorPatchTag
9-
tag-prefix: 'v'
9+
tag-prefix: '' # Ensure no prefix to match your existing tags
1010
continuous-delivery-fallback-tag: 'ci'
1111
commit-message-incrementing: Enabled
1212
branches:
1313
master:
1414
regex: ^master$|^main$
1515
tag: ''
16-
increment: Patch
16+
increment: Minor
1717
prevent-increment-of-merged-branch-version: true
1818
track-merge-target: false
1919
feature:

0 commit comments

Comments
 (0)