Skip to content

Initial Pull Request #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
cba39f9
init
Feb 2, 2024
a9bd00a
improvements
vilinski Feb 3, 2024
06def08
v1.2.1
vilinski Feb 3, 2024
f194176
add OSPlatform Linux
vilinski Feb 3, 2024
1ae1800
download latest libchdb
vilinski Feb 3, 2024
9f63b32
gh actions fix
vilinski Feb 4, 2024
3b603c5
dont cache the lib
vilinski Feb 4, 2024
df119a4
download lib later
vilinski Feb 4, 2024
07e709a
"
vilinski Feb 4, 2024
cdc4aaf
dotnet mess
vilinski Feb 4, 2024
be6a3fb
rename Session.Query
vilinski Feb 4, 2024
47b3ca4
linux comment out
vilinski Feb 4, 2024
7c4259b
test tool at last
vilinski Feb 4, 2024
f6458b7
change dotnet pack switch
vilinski Feb 4, 2024
e7a1467
typo
vilinski Feb 4, 2024
fc10a21
catch overflow in linux
vilinski Feb 4, 2024
f78b54b
typo
vilinski Feb 4, 2024
40d84df
comment out tool pack
vilinski Feb 4, 2024
28ae9a4
typo
vilinski Feb 4, 2024
4f24c25
wrap rethrow exception
vilinski Feb 4, 2024
00c21a4
move result unmarshaling from ctor
vilinski Feb 4, 2024
37a5c1e
output unmarshalled duration
vilinski Feb 4, 2024
a50b7dd
msbuild mess
vilinski Feb 4, 2024
91f4ff3
ugly duration exception handler
vilinski Feb 4, 2024
d90ce1a
comment out linux-x64
vilinski Feb 4, 2024
727b314
enable linux but disable wrong format test
vilinski Feb 4, 2024
9987049
remove console errors from library
vilinski Feb 4, 2024
438a513
kick ci
vilinski Feb 4, 2024
f7c0685
use free_result_v2 instead of Marshal.FreeHGlobal
vilinski Feb 4, 2024
b62f141
override Handle.ToString
vilinski Feb 4, 2024
8901f0e
disable ubuntu againt
vilinski Feb 4, 2024
ed214a2
check the theory
vilinski Feb 4, 2024
da3bcc8
allow test on linux again
vilinski Feb 4, 2024
13abeda
push to GPR, manual run
vilinski Feb 4, 2024
7b79a68
push to nuget.org
vilinski Feb 5, 2024
7d077cf
don't publisch nuget from ci for now
vilinski Feb 9, 2024
e042302
set env VERSION
vilinski Feb 9, 2024
d8eab06
env VERSION was a bad idea
vilinski Feb 9, 2024
9848601
try to publish nugets
vilinski Feb 9, 2024
b2738c2
buf is a binary result property
vilinski Feb 9, 2024
824dfec
disable push again
vilinski Feb 9, 2024
7f4d76f
remove flacky test condition
vilinski Feb 9, 2024
35bb5ab
reorganize conditional build
vilinski Feb 9, 2024
b4211da
job names, api-key for GPR
vilinski Feb 9, 2024
2efdfe9
wropg GPR namespace
vilinski Feb 9, 2024
6b87d28
right token for right repo
vilinski Feb 9, 2024
7359b5a
dunno why GPR dntwrk
vilinski Feb 9, 2024
9d3b737
show lib and nuget size
vilinski Feb 9, 2024
df3befd
try not include symbols
vilinski Feb 9, 2024
3f4dd3b
GPR token does not
vilinski Feb 9, 2024
05025a2
remove platform packages
vilinski Feb 10, 2024
5cc9fcf
valid version string
vilinski Feb 10, 2024
eb4d164
display vars
vilinski Feb 10, 2024
fc582b8
try to fix tool push job
vilinski Feb 10, 2024
ccd55d7
fix download step
vilinski Feb 10, 2024
5aa8fda
checkout in later jobs
vilinski Feb 10, 2024
bdb5015
download lib on each job
vilinski Feb 10, 2024
89b9732
nuget token for all jobs
vilinski Feb 10, 2024
7fcfe13
add api-key for push
vilinski Feb 10, 2024
0514167
first stable version 0.0.2
vilinski Feb 10, 2024
ff1f7a5
artifacts and tool test
vilinski Feb 10, 2024
178658d
copy lib in push jobs
vilinski Feb 10, 2024
84d1aab
add ls
vilinski Feb 10, 2024
1b8b1d0
no artifacts again
vilinski Feb 10, 2024
01a6ee9
netstandard2.1
vilinski Feb 18, 2024
8793f88
typo
vilinski Feb 18, 2024
d6f6ebb
fix tool test job
vilinski Feb 18, 2024
df1aeaf
push nuget on merge only
vilinski Feb 18, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: publish dotnet packages

on:
release:
types: [ created ]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup .NET Core 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
8.x
cache: true
- name: Download chdb library
run: ./update_libchdb.sh
- run: dotnet build --configuration Release
- name: Create the packages
run: dotnet pack --configuration Release --include-symbols
- name: Publish the package to nuget.org
run: dotnet nuget push nupkg/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.NUGET_TOKEN}}
169 changes: 169 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# 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: build

env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
required: true
default: 'Manual run'

jobs:
build_chdb:
name: Build chdb-${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: macos-latest
rid: osx-x64
- os: macos-14
rid: osx-arm64

steps:
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'

- uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
8.0.x
source-url: https://nuget.pkg.github.com/vilinski/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Display dotnet version
run: |
dotnet --version
echo "GITHUB_WORKSPACE $GITHUB_WORKSPACE"
echo "GITHUB_ACTION $GITHUB_ACTION"
echo "GITHUB_RUN_ID $GITHUB_RUN_ID"
echo "GITHUB_RUN_NUMBER $GITHUB_RUN_NUMBER"

- name: Restore
run: dotnet restore

- name: Download chdb library
run: ./update_libchdb.sh

- name: Build
run: |
# copy to the correct location
cp libchdb.so src/chdb/libchdb.so
ls -lahS src/chdb/libchdb*
dotnet build --no-restore --configuration Release

- name: Test
run: dotnet test -c Release --no-build --logger trx --results-directory "TestResults-${{ matrix.rid }}"

# - name: Upload dotnet test results
# uses: actions/upload-artifact@v4
# with:
# name: dotnet-results-${{ matrix.rid }}
# path: TestResults-${{ matrix.rid }}
# # 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: 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 }}

# - name: Publish chdb-${{ matrix.rid }} package to GPR
# run: dotnet nuget push nupkg/chdb-${{ matrix.rid }}.*.nupkg --skip-duplicate --api-key ${{ secrets.PACKAGES_TOKEN }} --source https://nuget.pkg.github.com/chdb-io/index.json
# env:
# NUGET_AUTH_TOKEN: ${{ secrets.PACKAGES_TOKEN }}

# - name: Upload nupkg
# #run: ls -l nupkg/*.nupkg
# uses: actions/upload-artifact@v4
# with:
# name: dotnet-nupkg-${{ matrix.rid }}
# path: nupkg

push_chdb:
if: github.event.pull_request.merged
name: Push chdb
needs: build_chdb
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Download chdb library
run: ./update_libchdb.sh

# - name: Upload libchdb Artifact
# uses: actions/upload-artifact@v4
# with:
# name: libchdb
# path: libchdb.so

- name: Pack
run: |
cp libchdb.so src/chdb/libchdb.so
ls -lahS src/chdb/libchdb*
dotnet pack src/chdb/chdb.csproj -c Release --include-symbols
ls -lahS nupkg

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


push_tool:
if: github.event.pull_request.merged
name: Push chdb-tool
needs: push_chdb
runs-on: ubuntu-latest
env:
PUSH_TOOL: true
steps:
- uses: actions/checkout@v4

- name: Download chdb library
run: ./update_libchdb.sh

- name: Pack
run: |
ls -lahS .
ls -lahS src/chdb/*
cp libchdb.so src/chdb/
ls -lahS src/chdb/libchdb*
dotnet nuget sources add -n chdb ./nupkg
dotnet pack src/chdb-tool/chdb-tool.csproj -c Release --include-symbols
ls -lahS nupkg

- name: Publish
run: dotnet nuget push nupkg/chdb-tool.*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_AUTH_TOKEN_CHDB }}

- name: Test chdb-tool
run: |
./update_libchdb.sh
dotnet tool install --add-source ./nupkg --global chdb-tool
which chdb
cp libchdb.so /home/runner/.dotnet/tools/
chdb --help
chdb "select version()" PrettyCompact
Loading