Skip to content

Commit cba39f9

Browse files
Andreas Vilinskivilinski
Andreas Vilinski
authored andcommitted
init
push nuget only on release
1 parent b329165 commit cba39f9

File tree

17 files changed

+1170
-0
lines changed

17 files changed

+1170
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: publish dotnet packages
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@v4
16+
- name: Setup .NET Core 8.x
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: |
20+
6.x
21+
8.x
22+
cache: true
23+
env:
24+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
25+
- name: Download chdb library
26+
run: ./update_libchdb.sh v1.2.0
27+
- run: dotnet build --configuration Release
28+
- name: Create the packages
29+
run: dotnet pack --configuration Release --include-symbols
30+
- name: Publish the package to nuget.org
31+
run: dotnet nuget push nupkg/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
32+
env:
33+
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}

.github/workflows/dotnet.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: dotnet build and test
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
dotnet-version: ['8.x' ]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Setup .NET Core 6.x
22+
uses: actions/setup-dotnet@v3
23+
with:
24+
dotnet-version: |
25+
6.0.x
26+
8.0.x
27+
# cache: true
28+
- name: Display dotnet version
29+
run: dotnet --version
30+
env:
31+
DOTNET_NOLOGO: 1
32+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
33+
# - name: Setup dotnet ${{ matrix.dotnet-version }}
34+
# uses: actions/setup-dotnet@v3
35+
# with:
36+
# dotnet-version: ${{ matrix.dotnet-version }}
37+
38+
# - name: Cache libchdb.so
39+
# id: cache-libchdb
40+
# uses: actions/cache@v4
41+
# with:
42+
# path: libchdb.so
43+
# key: ${{ runner.os }}-libchdb
44+
- name: Download chdb library
45+
if: steps.cache-libchdb.outputs.cache-hit != 'true'
46+
run: ./update_libchdb.sh v1.2.0
47+
# - uses: actions/cache@v3
48+
# with:
49+
# path: ~/.nuget/packages
50+
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
51+
# restore-keys: |
52+
# ${{ runner.os }}-nuget-
53+
54+
- name: Restore
55+
run: dotnet restore
56+
- name: Build
57+
run: dotnet build --no-restore --configuration Release
58+
- name: Test
59+
run: dotnet test --configuration Release --no-build --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
60+
- name: Upload dotnet test results
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: dotnet-results-${{ matrix.dotnet-version }}
64+
path: TestResults-${{ matrix.dotnet-version }}
65+
# Use always() to always run this step to publish test results when there are test failures
66+
if: ${{ always() }}
67+
- name: Pack
68+
run: dotnet pack -c Release --include-symbols
69+
# - name: Publish the package to nuget.org
70+
# run: dotnet nuget push nupkg/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
71+
# env:
72+
# NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}

0 commit comments

Comments
 (0)