Skip to content

Commit

Permalink
remove platform packages
Browse files Browse the repository at this point in the history
  • Loading branch information
vilinski committed Feb 10, 2024
1 parent 3f4dd3b commit 05025a2
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 64 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: dotnet build and test
name: build

env:
DOTNET_NOLOGO: 1
Expand All @@ -20,7 +20,7 @@ on:
default: 'Manual run'

jobs:
build_chdb_native:
build_chdb:
name: Build chdb-${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -61,6 +61,8 @@ jobs:
run: |
./update_libchdb.sh
ls -lahS src/chdb/libchdb*
# move to the correct location
cp libchdb.so src/chdb/libchdb.so
- name: Build
run: dotnet build --no-restore --configuration Release
Expand All @@ -76,13 +78,13 @@ jobs:
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- name: Pack chdb-${{ matrix.rid }}
run: |
dotnet pack src/chdb/chdb.csproj -c Release
ls -lahS nupkg
# - name: Pack chdb-${{ matrix.rid }}
# run: |
# dotnet pack src/chdb/chdb.csproj -c Release
# ls -lahS nupkg

- name: Publish the package to nuget.org
run: dotnet nuget push nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}
# - name: Publish the package to nuget.org
# run: dotnet nuget push nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}
# env:
# NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}

Expand All @@ -98,15 +100,15 @@ jobs:
# name: dotnet-nupkg-${{ matrix.rid }}
# path: nupkg

build_chdb:
name: Build chdb
needs: build_chdb_native
push_chdb:
name: Push chdb
needs: build_chdb
runs-on: ubuntu-latest
steps:

- name: Pack
run: |
dotnet pack src/chdb-meta/chdb-meta.csproj -c Release --include-symbols
dotnet pack src/chdb/chdb.csproj -c Release --include-symbols --version-suffix ${{ github.run_number }}
ls -lahS nupkg
- name: Publish the package to nuget.org
Expand All @@ -115,23 +117,31 @@ jobs:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}


build_tool:
name: Build chdb-tool
needs: build_chdb
push_tool:
name: Push chdb-tool
needs: push_chdb
runs-on: ubuntu-latest
steps:
- name: Pack
run: |
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release --include-symbols
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release --include-symbols --version-suffix ${{ github.run_number }}
ls -lahS nupkg
- name: Publish
run: dotnet nuget push nupkg/chdb-tool.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}

- name: Download chdb library
run: |
./update_libchdb.sh
ls -lahS src/chdb/libchdb*
# move to the correct location
cp libchdb.so src/chdb/libchdb.so
- name: Test chdb-tool
run: |
dotnet tool install --add-source ./nupkg --global chdb-tool-${{ matrix.rid }} --version 0.0.1-alpha.01
dotnet tool install --add-source ./nupkg --global chdb-tool
which chdb
chdb --help
chdb "select version()" PrettyCompact
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageOutputPath>../../nupkg</PackageOutputPath>
<Version>0.0.1-alpha</Version>
<Version>0.0.2-alpha.0$(GITHUB_RUN_NUMBER)</Version>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<PackageVersion Condition="'$(BuildNumber)' != ''">$(Version).$(BuildNumber)</PackageVersion>
<Authors>vilinski</Authors>
Expand Down
48 changes: 10 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,19 @@ A .NET Core binding for [chdb](https://doc.chdb.io) library.

![GitHub License](https://img.shields.io/github/license/chdb-io/chdb-dotnet)
![example workflow](https://github.com/chdb-io/chdb-dotnet/actions/workflows/dotnet.yml/badge.svg)

<table>
<thead>
<tr>
<th>OS</th>
<th>Arch</th>
<th>chdb</th>
<th>downloads</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">OSX</td>
<td>arm64</td>
<td><img src="https://img.shields.io/nuget/vpre/chdb-osx-arm64"></td>
<td><img src="https://img.shields.io/nuget/dt/chdb-osx-arm64"></td>
</tr>
<tr>
<td>x64</td>
<td><img src="https://img.shields.io/nuget/vpre/chdb-osx-x64"></td>
<td><img src="https://img.shields.io/nuget/dt/chdb-osx-x64"></td>
</tr>
<tr>
<td rowspan="2">Linux</td>
<td>arm64</td>
<td><img src="https://img.shields.io/nuget/vpre/chdb-linux-arm64"></td>
<td><img src="https://img.shields.io/nuget/dt/chdb-linux-arm64"></td>
</tr>
<tr>
<td>x64</td>
<td><img src="https://img.shields.io/nuget/vpre/chdb-linux-x64"></td>
<td><img src="https://img.shields.io/nuget/dt/chdb-linux-x64"></td>
</tr>
</tbody>
</table>
![NuGet Version](https://img.shields.io/nuget/vpre/chdb)
![NuGet Downloads](https://img.shields.io/nuget/dt/chdb)

### Usage

Running on platforms: linux, osx, windows, and architectures: x64, arm64.

>Note for windows users - there is no windows bild in sight, but you can still use it in WSL.
Currently the librairy is too large to be packed into a nuget package, so you need to install it manually. Use the [update_libchdb.sh](update_libchdb.sh) script to download the library for your platform and architecture.

```bash
./update_libchdb.sh
dotnet add package chdb
```

Expand Down Expand Up @@ -71,9 +45,7 @@ Console.WriteLine(result.Text);
![NuGet Downloads](https://img.shields.io/nuget/dt/chdb-tool)

This is a dotnet tool, running [chdb](https://doc.chdb.io) library.
Actually you better install the clickhouse client and run `clickhouse local`, but maybe it is more useful for some cases.

>Note for windows users - there is no windows bild in sight, but you can use it in WSL.
Probably you better served using the clickhouse client and run `clickhouse local`, but maybe it is more useful in some cases.

### Installation

Expand Down
4 changes: 2 additions & 2 deletions src/chdb-tool/chdb-tool.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\chdb\chdb.csproj" Condition="$(IsGithubAction) == true" />
<PackageReference Include="chdb" Version="$(Version)" Condition="$(IsGithubAction) != true" />
<ProjectReference Include="..\chdb\chdb.csproj" Condition="'$(GITHUB_ACTIONS)' != 'true'" />
<PackageReference Include="chdb" Version="$(Version)" Condition="'$(GITHUB_ACTIONS)' == 'true'" />

<!-- <PackageReference Include="chdb-linux-x64" Version="$(Version)" Condition="$(IsLinuxX64) == true"/>
<PackageReference Include="chdb-linux-arm64" Version="$(Version)" Condition="$(IsLinuxArm64) == true"/>
Expand Down
7 changes: 4 additions & 3 deletions src/chdb/chdb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

<PropertyGroup>
<InternalsVisibleTo>tests</InternalsVisibleTo>
<PackageId Condition="$(IsLinuxX64) == true" >chdb-linux-x64</PackageId>
<!-- <PackageId Condition="$(IsLinuxX64) == true" >chdb-linux-x64</PackageId>
<PackageId Condition="$(IsLinuxArm64) == true" >chdb-linux-arm64</PackageId>
<PackageId Condition="$(IsOsxX64) == true" >chdb-osx-x64</PackageId>
<PackageId Condition="$(IsOsxArm64) == true" >chdb-osx-arm64</PackageId>
<PackageId Condition="$(IsOsxArm64) == true" >chdb-osx-arm64</PackageId> -->
<PackageId>chdb</PackageId>
<Title>chdb</Title>
<Description>chdb native bindings for dotnet core</Description>
</PropertyGroup>

<ItemGroup>
<Content Include="libchdb.so" Pack="true" CopyToOutputDirectory="PreserveNewest" />
<Content Include="libchdb.so" Pack="false" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions update_libchdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,3 @@ chmod +x libchdb.so

# Clean up
rm -f libchdb.tar.gz

# move to the correct location
mv libchdb.so src/chdb/libchdb.so

0 comments on commit 05025a2

Please sign in to comment.