Initial Pull Request #52
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
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_native: | |
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 | |
- name: Restore | |
run: dotnet restore | |
- name: Download chdb library | |
run: | | |
./update_libchdb.sh | |
ls -lahS src/chdb/libchdb* | |
- name: Build | |
run: 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 | |
build_chdb: | |
name: Build chdb | |
needs: build_chdb_native | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pack | |
run: | | |
dotnet pack src/chdb-meta/chdb-meta.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 | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN_CHDB }} | |
build_tool: | |
name: Build chdb-tool | |
needs: build_chdb | |
runs-on: ubuntu-latest | |
steps: | |
- name: Pack | |
run: | | |
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 | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN_CHDB }} | |
- name: Test chdb-tool | |
run: | | |
dotnet tool install --add-source ./nupkg --global chdb-tool-${{ matrix.rid }} --version 0.0.1-alpha.01 | |
chdb --help | |
chdb "select version()" PrettyCompact |