Skip to content

Commit b5f6ac5

Browse files
committed
Improve build & pack
1 parent 40e6186 commit b5f6ac5

9 files changed

Lines changed: 92 additions & 46 deletions

File tree

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616

1717
- name: Setup .NET SDK
1818
uses: actions/setup-dotnet@v5
@@ -23,7 +23,7 @@ jobs:
2323
run: dotnet --info
2424

2525
- name: Cache NuGet packages
26-
uses: actions/cache@v4
26+
uses: actions/cache@v5
2727
with:
2828
path: ~/.nuget/packages
2929
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/global.json', '**/nuget.config') }}
@@ -37,4 +37,19 @@ jobs:
3737
run: dotnet build --configuration Release --nologo -warnaserror
3838

3939
- name: Test (Release)
40-
run: dotnet test --configuration Release --nologo --no-build
40+
run: dotnet test --configuration Release --nologo --no-build
41+
42+
- name: pack (nupkg + snupkg, prerelease)
43+
run: dotnet pack src/NuExt.System.Data.SQLite.csproj -c Release -o artifacts --nologo /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -p:VersionSuffix="pre.${{ github.run_number }}"
44+
45+
- name: upload nupkg
46+
uses: actions/upload-artifact@v7
47+
with:
48+
name: nuext-system-data-sqlite-nupkg
49+
path: artifacts/*.nupkg
50+
51+
- name: upload snupkg
52+
uses: actions/upload-artifact@v7
53+
with:
54+
name: nuext-system-data-sqlite-snupkg
55+
path: artifacts/*.snupkg

Directory.Build.props

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,6 @@
44
<LangVersion>14</LangVersion>
55
</PropertyGroup>
66

7-
<!-- NuGet -->
8-
<PropertyGroup>
9-
<Authors>ivanvoyager</Authors>
10-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11-
<Copyright>Copyright (c) $(Authors) $([System.DateTime]::Today.ToString(yyyy))</Copyright>
12-
</PropertyGroup>
13-
14-
<!-- SourceLink -->
15-
<PropertyGroup>
16-
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
17-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18-
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
19-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
20-
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
21-
<IncludeSymbols>true</IncludeSymbols>
22-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
23-
</PropertyGroup>
24-
25-
<!-- Sign assembly -->
26-
<PropertyGroup>
27-
<SignAssembly>true</SignAssembly>
28-
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)MyPublicKey.snk</AssemblyOriginatorKeyFile>
29-
<PublicSign>true</PublicSign>
30-
</PropertyGroup>
31-
32-
<PropertyGroup>
33-
<UseNuExtPackages>true</UseNuExtPackages>
34-
</PropertyGroup>
35-
7+
<!-- Imports -->
8+
<Import Project="$(MSBuildThisFileDirectory)\..\Directory.Build.props" Condition="Exists('$(MSBuildThisFileDirectory)\..\Directory.Build.props')" />
369
</Project>

NuExt.System.Data.SQLite.slnx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Solution>
2-
<Project Path="samples/MoviesAppSample/MoviesAppSample.csproj" />
2+
<Folder Name="/Solution Items/">
3+
<File Path="Directory.Build.props" />
4+
<File Path="Directory.Build.targets" />
5+
<File Path="README.md" />
6+
</Folder>
37
<Project Path="src/NuExt.System.Data.SQLite.csproj" />
48
<Project Path="tests/NuExt.System.Data.SQLite.Tests.csproj" />
59
</Solution>
File renamed without changes.

src/Directory.Build.props

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<Project>
2+
<!-- Package metadata -->
3+
<PropertyGroup>
4+
<Authors>ivanvoyager</Authors>
5+
<Company>ivanvoyager</Company>
6+
<Copyright>Copyright (c) $(Authors) $([System.DateTime]::Today.ToString(yyyy))</Copyright>
7+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
8+
<IsPackable>true</IsPackable>
9+
<PackageIcon>logo.png</PackageIcon>
10+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
11+
<PackageProjectUrl>https://github.com/nu-ext/NuExt.System.Data.SQLite</PackageProjectUrl>
12+
<PackageReadmeFile>README.md</PackageReadmeFile>
13+
<PackageTags>nuext;sqlite;database;ado.net;provider;interop;async</PackageTags>
14+
</PropertyGroup>
15+
16+
<!-- SourceLink -->
17+
<PropertyGroup>
18+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
19+
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
20+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
21+
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
22+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
23+
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
24+
<IncludeSymbols>true</IncludeSymbols>
25+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
26+
</PropertyGroup>
27+
28+
<!-- Sign assembly -->
29+
<PropertyGroup Condition="!Exists('$(MSBuildThisFileDirectory)\..\..\MyKey.snk')">
30+
<SignAssembly>true</SignAssembly>
31+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\..\MyPublicKey.snk</AssemblyOriginatorKeyFile>
32+
<PublicSign>true</PublicSign>
33+
</PropertyGroup>
34+
<PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory)\..\..\MyKey.snk')">
35+
<SignAssembly>true</SignAssembly>
36+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\..\..\MyKey.snk</AssemblyOriginatorKeyFile>
37+
<PublicSign>false</PublicSign>
38+
</PropertyGroup>
39+
40+
<ItemGroup>
41+
<None Include="../assets/logo.png" Pack="true" PackagePath="\" />
42+
<None Include="../README.md" Pack="true" PackagePath="\" />
43+
</ItemGroup>
44+
45+
<!-- Imports -->
46+
<Import Project="$(MSBuildThisFileDirectory)\..\Directory.Build.props" />
47+
48+
</Project>

src/NuExt.System.Data.SQLite.csproj

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,23 @@
44
<TargetFrameworks>netstandard2.1;netstandard2.0;net10.0;net9.0;net8.0;net471;net462</TargetFrameworks>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
8-
<PackageTags>nuext;sqlite;database;ado.net;provider;interop;async</PackageTags>
97
<Description>High‑performance SQLite data access utilities for .NET, providing thread‑safe connection handling, reliable transaction management, and a consistent DAL foundation. Includes context and converter abstractions to simplify schema updates, coordinate concurrent operations, and ensure predictable behavior across SQLite’s locking model.</Description>
10-
<Version>0.7.3</Version>
118
<RootNamespace />
129
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1310
<NoWarn>$(NoWarn);1591;NETSDK1233</NoWarn>
14-
<PackageReadmeFile>README.md</PackageReadmeFile>
15-
<PackageIcon>logo.png</PackageIcon>
16-
<PackageProjectUrl>https://github.com/nu-ext/NuExt.System.Data.SQLite</PackageProjectUrl>
11+
<VersionPrefix>0.7.4</VersionPrefix>
1712
</PropertyGroup>
1813

1914
<ItemGroup>
2015
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
2116
</ItemGroup>
2217

23-
<ItemGroup Condition="'$(UseNuExtPackages)' == 'true'">
18+
<ItemGroup Condition="'$(NuExt_UseLocalProjects)' != 'true'">
2419
<PackageReference Include="NuExt.System.Data" Version="0.7.3" />
2520
</ItemGroup>
2621

27-
<ItemGroup Condition="'$(UseNuExtPackages)' == 'false'">
22+
<ItemGroup Condition="'$(NuExt_UseLocalProjects)' == 'true'">
2823
<ProjectReference Include="..\..\NuExt.System.Data\src\NuExt.System.Data.csproj" />
2924
</ItemGroup>
3025

31-
<ItemGroup>
32-
<None Include="..\logo.png" Pack="true" PackagePath="\" />
33-
<None Include="..\README.md" Pack="true" PackagePath="\" />
34-
</ItemGroup>
35-
3626
</Project>

tools/pack.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
powershell -ExecutionPolicy Bypass -File "%~dp0pack.ps1"
3+
pause

tools/pack.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
$csproj = "$PSScriptRoot\..\src\NuExt.System.Data.SQLite.csproj"
2+
$Configuration = "Release"
3+
$outDir = $PSScriptRoot
4+
5+
dotnet clean $csproj -c $Configuration
6+
dotnet build $csproj -c $Configuration
7+
dotnet pack $csproj -c $Configuration -o $outDir

0 commit comments

Comments
 (0)