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
84 changes: 52 additions & 32 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Preview Release
name: Fork Package Release

on:
release:
Expand All @@ -9,8 +9,12 @@ permissions:
id-token: write

jobs:
publish-preview:
if: github.event.release.prerelease == true && startsWith(github.event.release.tag_name, 'v1.5.4-preview.')
publish-fork-package:
if: >-
(github.event.release.prerelease == true &&
startsWith(github.event.release.tag_name, 'v1.5.4-preview.')) ||
(github.event.release.prerelease == false &&
github.event.release.tag_name == 'v1.5.4')
runs-on: ubuntu-latest
environment: nuget-preview

Expand All @@ -21,16 +25,28 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}

- name: Set preview version
- name: Set package version and release mode
shell: bash
run: |
version="${{ github.event.release.tag_name }}"
version="${version#v}"
if [[ ! "$version" =~ ^1\.5\.4-preview\.[0-9]+$ ]]; then
echo "Unexpected preview version: $version" >&2

if [[ "$version" =~ ^1\.5\.4-preview\.[0-9]+$ ]]; then
fork_preview=true
fork_release=false
elif [[ "$version" == "1.5.4" ]]; then
fork_preview=false
fork_release=true
else
echo "Unexpected fork package version: $version" >&2
exit 1
fi
echo "PREVIEW_VERSION=$version" >> "$GITHUB_ENV"

{
echo "PACKAGE_VERSION=$version"
echo "FORK_PREVIEW=$fork_preview"
echo "FORK_RELEASE=$fork_release"
} >> "$GITHUB_ENV"

- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
Expand All @@ -48,9 +64,10 @@ jobs:
/m:1
/p:BuildType=Full
/p:CI=false
/p:ForkPreview=true
/p:Version=${{ env.PREVIEW_VERSION }}
/p:PackageVersion=${{ env.PREVIEW_VERSION }}
/p:ForkPreview="$FORK_PREVIEW"
/p:ForkRelease="$FORK_RELEASE"
/p:Version="$PACKAGE_VERSION"
/p:PackageVersion="$PACKAGE_VERSION"
/p:UseSharedCompilation=false

- name: Test
Expand All @@ -62,70 +79,73 @@ jobs:
--logger "console;verbosity=quiet"
/p:BuildType=Full
/p:CI=false
/p:ForkPreview=true
/p:ForkPreview="$FORK_PREVIEW"
/p:ForkRelease="$FORK_RELEASE"
/p:DoesNotReturnAttribute=DoesNotReturnAttribute

- name: Pack preview packages
- name: Pack fork packages
shell: bash
run: |
mkdir -p artifacts/preview
mkdir -p artifacts/fork-release
common_args=(
--configuration Release
--no-build
--no-restore
--output artifacts/preview
--output artifacts/fork-release
/m:1
/p:BuildType=Full
/p:CI=false
/p:ForkPreview=true
/p:PreviewPack=true
/p:Version="$PREVIEW_VERSION"
/p:PackageVersion="$PREVIEW_VERSION"
/p:ForkPreview="$FORK_PREVIEW"
/p:ForkRelease="$FORK_RELEASE"
/p:ForkPack=true
/p:Version="$PACKAGE_VERSION"
/p:PackageVersion="$PACKAGE_VERSION"
)
dotnet pack DuckDB.NET.Bindings/Bindings.csproj "${common_args[@]}"

dotnet restore DuckDB.NET.Data/Data.csproj \
--source artifacts/preview \
--source artifacts/fork-release \
--source https://api.nuget.org/v3/index.json \
/p:BuildType=Full \
/p:CI=false \
/p:ForkPreview=true \
/p:PreviewPack=true \
/p:Version="$PREVIEW_VERSION" \
/p:PackageVersion="$PREVIEW_VERSION"
/p:ForkPreview="$FORK_PREVIEW" \
/p:ForkRelease="$FORK_RELEASE" \
/p:ForkPack=true \
/p:Version="$PACKAGE_VERSION" \
/p:PackageVersion="$PACKAGE_VERSION"

dotnet pack DuckDB.NET.Data/Data.csproj "${common_args[@]}"

- name: Validate and smoke-test packages
run: ./scripts/validate-preview-packages.sh artifacts/preview "$PREVIEW_VERSION"
run: ./scripts/validate-fork-packages.sh artifacts/fork-release "$PACKAGE_VERSION"

- name: Generate checksums
working-directory: artifacts/preview
working-directory: artifacts/fork-release
run: sha256sum *.nupkg > SHA256SUMS

- name: Upload workflow artifacts
uses: actions/upload-artifact@v7
with:
name: duckdb-net-${{ env.PREVIEW_VERSION }}
name: duckdb-net-${{ github.event.release.tag_name }}
path: |
artifacts/preview/*.nupkg
artifacts/preview/SHA256SUMS
artifacts/fork-release/*.nupkg
artifacts/fork-release/SHA256SUMS
if-no-files-found: error

- name: Attach packages to GitHub prerelease
- name: Attach packages to GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" artifacts/preview/* --clobber
run: gh release upload "${{ github.event.release.tag_name }}" artifacts/fork-release/* --clobber

- name: Authenticate to NuGet.org
uses: NuGet/login@v1
id: nuget-login
with:
user: skuirrels

- name: Publish preview packages to NuGet.org
- name: Publish fork packages to NuGet.org
run: >-
dotnet nuget push "artifacts/preview/*.nupkg"
dotnet nuget push "artifacts/fork-release/*.nupkg"
--api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}"
--source https://api.nuget.org/v3/index.json
--skip-duplicate
20 changes: 15 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
<Company>Giorgi Dalakishvili</Company>
<Copyright>Copyright © 2020 - $(Year) Giorgi Dalakishvili</Copyright>

<ForkPackagePrefix Condition="'$(ForkPreview)' == 'true' AND '$(ForkPackagePrefix)' == ''">Skuirrels.</ForkPackagePrefix>
<ForkPackageBuild Condition="'$(ForkPreview)' == 'true' OR '$(ForkRelease)' == 'true'">true</ForkPackageBuild>
<ForkPackagePrefix Condition="'$(ForkPackageBuild)' == 'true' AND '$(ForkPackagePrefix)' == ''">Skuirrels.</ForkPackagePrefix>
<Product>DuckDB.NET.$(MSBuildProjectName)</Product>
<PackageId>$(ForkPackagePrefix)DuckDB.NET.$(MSBuildProjectName)</PackageId>
<PackageTags>DuckDB;ADO.NET;Database;Olap;Embedded</PackageTags>
<PackageIcon>Logo.jpg</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReadmeFile Condition="'$(ForkPreview)' == 'true'">README-PREVIEW.md</PackageReadmeFile>
<PackageReadmeFile Condition="'$(ForkRelease)' == 'true'">README-FORK.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<Deterministic>true</Deterministic>
Expand All @@ -40,7 +42,7 @@

</PropertyGroup>

<PropertyGroup Condition="'$(ForkPreview)' == 'true'">
<PropertyGroup Condition="'$(ForkPackageBuild)' == 'true'">
<RepositoryUrl>https://github.com/skuirrels/DuckDB.NET</RepositoryUrl>
<PackageProjectUrl>https://github.com/skuirrels/DuckDB.NET</PackageProjectUrl>
</PropertyGroup>
Expand Down Expand Up @@ -74,13 +76,21 @@
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\README-FORK.md" Condition="'$(ForkRelease)' == 'true'">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<Target Name="ValidateForkPreviewPackageMetadata" BeforeTargets="Pack" Condition="'$(ForkPreview)' == 'true'">
<Target Name="ValidateForkPackageMetadata" BeforeTargets="Pack" Condition="'$(ForkPackageBuild)' == 'true'">
<Error Condition="'$(ForkPreview)' == 'true' AND '$(ForkRelease)' == 'true'"
Text="ForkPreview and ForkRelease cannot both be enabled." />
<Error Condition="$([System.String]::Copy('$(PackageId)').StartsWith('Skuirrels.')) != 'True'"
Text="Fork preview packages must use the Skuirrels package prefix." />
<Error Condition="$([System.String]::Copy('$(PackageVersion)').Contains('-preview.')) != 'True'"
Text="Fork packages must use the Skuirrels package prefix." />
<Error Condition="'$(ForkPreview)' == 'true' AND $([System.String]::Copy('$(PackageVersion)').Contains('-preview.')) != 'True'"
Text="Fork preview package versions must contain the -preview. prerelease suffix." />
<Error Condition="'$(ForkRelease)' == 'true' AND $([System.String]::Copy('$(PackageVersion)').Contains('-')) == 'True'"
Text="Stable fork package versions must not contain a prerelease suffix." />
</Target>

<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
Expand Down
2 changes: 2 additions & 0 deletions DuckDB.NET.Bindings/Bindings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
</PackageReleaseNotes>
<Description Condition="'$(ForkPreview)' == 'true'">Unofficial preview build of the DuckDB native bindings from the skuirrels DuckDB.NET fork.</Description>
<PackageReleaseNotes Condition="'$(ForkPreview)' == 'true'">Unofficial preview bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4.</PackageReleaseNotes>
<Description Condition="'$(ForkRelease)' == 'true'">Unofficial stable build of the DuckDB native bindings from the skuirrels DuckDB.NET fork.</Description>
<PackageReleaseNotes Condition="'$(ForkRelease)' == 'true'">Stable fork bindings for the consolidated DuckDB.NET performance work, bundling DuckDB v1.5.4.</PackageReleaseNotes>
<RootNamespace>DuckDB.NET.Native</RootNamespace>
<RuntimeIdentifiers>win-x64;win-arm64;linux-x64;linux-arm64;osx</RuntimeIdentifiers>
<DuckDbArtifactRoot Condition=" '$(DuckDbArtifactRoot)' == '' ">https://github.com/duckdb/duckdb/releases/download/v1.5.4</DuckDbArtifactRoot>
Expand Down
6 changes: 4 additions & 2 deletions DuckDB.NET.Data/Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Fixes:
</PackageReleaseNotes>
<Description Condition="'$(ForkPreview)' == 'true'">Unofficial preview build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork.</Description>
<PackageReleaseNotes Condition="'$(ForkPreview)' == 'true'">Unofficial preview of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages.</PackageReleaseNotes>
<Description Condition="'$(ForkRelease)' == 'true'">Unofficial stable build of the DuckDB ADO.NET provider from the skuirrels DuckDB.NET fork.</Description>
<PackageReleaseNotes Condition="'$(ForkRelease)' == 'true'">Stable fork release of the consolidated DuckDB.NET performance work for DuckDB v1.5.4. Do not reference this package alongside the official DuckDB.NET packages.</PackageReleaseNotes>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\keyPair.snk</AssemblyOriginatorKeyFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -40,11 +42,11 @@ Fixes:
<PackageReference Include="Apache.Arrow" Version="23.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(PreviewPack)' != 'true'">
<ItemGroup Condition="'$(ForkPack)' != 'true'">
<ProjectReference Include="..\DuckDB.NET.Bindings\Bindings.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(ForkPreview)' == 'true' AND '$(PreviewPack)' == 'true'">
<ItemGroup Condition="'$(ForkPackageBuild)' == 'true' AND '$(ForkPack)' == 'true'">
<PackageReference Include="$(ForkPackagePrefix)DuckDB.NET.Bindings.Full" Version="$(PackageVersion)" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion DuckDB.NET.Test/Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>

<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
33 changes: 33 additions & 0 deletions README-FORK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Skuirrels DuckDB.NET fork

This is an unofficial stable build from the
[`skuirrels/DuckDB.NET`](https://github.com/skuirrels/DuckDB.NET) fork. It
packages the consolidated performance work for DuckDB v1.5.4 under distinct
`Skuirrels.DuckDB.NET.*` package IDs.

Install the bundled provider explicitly:

```shell
dotnet add package Skuirrels.DuckDB.NET.Data.Full --version 1.5.4
```

NuGet packages:

- [`Skuirrels.DuckDB.NET.Data.Full`](https://www.nuget.org/packages/Skuirrels.DuckDB.NET.Data.Full/)
- [`Skuirrels.DuckDB.NET.Bindings.Full`](https://www.nuget.org/packages/Skuirrels.DuckDB.NET.Bindings.Full/)

The package keeps the official `DuckDB.NET.Data` namespaces and assembly names,
so application source code does not need to change. Do not reference this fork
package and the official `DuckDB.NET.Data.Full` package in the same dependency
graph because they contain assemblies with the same identities.

This release bundles DuckDB v1.5.4 and includes the consolidated appender,
parameter binding, prepared-command, result materialisation, and scoped-writer
optimisations from the fork. When equivalent upstream changes are released,
move back to the official `DuckDB.NET.Data.Full` package.

The original DuckDB.NET and DuckDB licences and attribution are included in the
package.

Report fork-specific problems in the
[`skuirrels/DuckDB.NET` issue tracker](https://github.com/skuirrels/DuckDB.NET/issues/new).
Loading
Loading