Skip to content

Commit 368483b

Browse files
committed
Try to add mac support in different way
* Build package with the specified .nuspec file * Override TargetFramework for dependencies to .net6 without "windows" part
1 parent a5ba518 commit 368483b

3 files changed

Lines changed: 59 additions & 23 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build and Publish Nuget Package
22

33
on:
44
push:
5+
branches:
6+
- '**'
57
tags:
68
- 'v*.*.*'
79

@@ -25,10 +27,18 @@ jobs:
2527
- name: Build
2628
run: dotnet build --no-restore --configuration Release --output ./nupkg
2729

30+
- name: Upload NuGet package as artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: nuget-package
34+
path: ./nupkg/*.nupkg
35+
2836
- name: Publish to NuGet.org
37+
if: startsWith(github.ref, 'refs/tags/v')
2938
run: dotnet nuget push --skip-duplicate ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
3039

3140
- name: Create GitHub Release
41+
if: startsWith(github.ref, 'refs/tags/v')
3242
uses: softprops/action-gh-release@v2
3343
with:
3444
files: ./nupkg/*.nupkg

Linq2MongoDB.LINQPadDriver/Linq2MongoDB.LINQPadDriver.csproj

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
<Title>MongoDB LINQPad driver</Title>
1818
<Description>MongoDB LINQPad driver that allows you to access MongoDB using Linq queries without having to provide custom assembly types</Description>
1919
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
20-
<Version>1.0.3-alpha-mac</Version>
20+
<Version>1.0.3-alpha2-mac</Version>
2121
<PackageReadmeFile>README.md</PackageReadmeFile>
22+
<GenerateNuspec>false</GenerateNuspec>
23+
<NuspecFile>Linq2MongoDB.LINQPadDriver.nuspec</NuspecFile>
24+
<NuspecProperties>Version=$(Version);Configuration=$(Configuration);OutputPath=$(OutputPath)</NuspecProperties>
2225
</PropertyGroup>
2326
<ItemGroup>
2427
<PackageReference Include="LINQPad.Reference" Version="1.3.1" />
@@ -44,29 +47,7 @@
4447
<PackagePath>\</PackagePath>
4548
</None>
4649
</ItemGroup>
47-
48-
<PropertyGroup>
49-
<!-- stop default lib/<tfm>/ assembly placement -->
50-
<IncludeBuildOutput>false</IncludeBuildOutput>
51-
</PropertyGroup>
52-
<ItemGroup>
53-
<!-- pack the built driver DLL into lib/net6.0/ -->
54-
<None Include="$(TargetPath)"
55-
Pack="true"
56-
PackagePath="lib\net6.0" />
5750

58-
<!-- optional but usually nice to ship alongside -->
59-
<None Include="$(TargetDir)$(AssemblyName).pdb"
60-
Pack="true"
61-
PackagePath="lib\net6.0"
62-
Condition="Exists('$(TargetDir)$(AssemblyName).pdb')" />
63-
64-
<None Include="$(TargetDir)$(AssemblyName).xml"
65-
Pack="true"
66-
PackagePath="lib\net6.0"
67-
Condition="Exists('$(TargetDir)$(AssemblyName).xml')" />
68-
</ItemGroup>
69-
7051
<!-- This PostBuild action installs the Driver -->
7152
<Target Condition="'$(Configuration)' == 'Debug'" Name="PostBuild1" AfterTargets="PostBuildEvent">
7253
<Exec Command="xcopy /i/y/s &quot;$(TargetDir)*.*&quot; &quot;%25LocalAppData%25\\LINQPad\\Drivers\\DataContext\\NetCore\\$(TargetName)&quot;" />
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>Linq2MongoDB.LINQPadDriver</id>
5+
<version>$Version$</version>
6+
<title>MongoDB LINQPad driver</title>
7+
<authors>Sirozha1337</authors>
8+
<description>LINQPad Driver</description>
9+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
10+
<license type="expression">MIT</license>
11+
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
12+
<readme>README.md</readme>
13+
<projectUrl>https://github.com/Sirozha1337/Linq2MongoDB.LINQPadDriver</projectUrl>
14+
<description>MongoDB LINQPad driver that allows you to access MongoDB using Linq queries without having to provide custom assembly types</description>
15+
<tags>linqpaddriver linqpad linqpad-samples mongo mongodb</tags>
16+
<repository type="git" url="https://github.com/Sirozha1337/Linq2MongoDB.LINQPadDriver" />
17+
18+
<dependencies>
19+
<group targetFramework="net6.0">
20+
<dependency id="LINQPad.Reference" version="1.3.1" exclude="Build,Analyzers" />
21+
<dependency id="MongoDB.Driver" version="3.2.1" exclude="Build,Analyzers" />
22+
</group>
23+
</dependencies>
24+
25+
<frameworkReferences>
26+
<group targetFramework="net6.0-windows7.0">
27+
<frameworkReference name="Microsoft.WindowsDesktop.App.WPF" />
28+
</group>
29+
</frameworkReferences>
30+
31+
<contentFiles>
32+
<files include="any/net6.0-windows7.0/Connection.png" buildAction="Content" />
33+
<files include="any/net6.0-windows7.0/FailedConnection.png" buildAction="Content" />
34+
<files include="any/net6.0-windows7.0/linqpad-samples/CRUD.linq" buildAction="Content" />
35+
</contentFiles>
36+
</metadata>
37+
38+
<files>
39+
<file src="$OutputPath$\**\*.*" target="lib\net6.0" />
40+
<file src="$OutputPath$\Connection.png" target="contentFiles\any\net6.0-windows7.0" />
41+
<file src="$OutputPath$\FailedConnection.png" target="contentFiles\any\net6.0-windows7.0" />
42+
<file src="$OutputPath$\linqpad-samples\CRUD.linq" target="contentFiles\any\net6.0-windows7.0\linqpad-samples" />
43+
<file src="..\README.md" target="\" />
44+
</files>
45+
</package>

0 commit comments

Comments
 (0)