-
-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (139 loc) · 4.84 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# 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:
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:
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