Skip to content

Commit

Permalink
ci: Release to Nuget.org (#48)
Browse files Browse the repository at this point in the history
* ci: release.yml

* Rename build.yml to release.yml

* ci: test.yml

* chore: revert to "Build" test.yml
  • Loading branch information
Anush008 authored Mar 7, 2024
1 parent 6dd9436 commit b3b80fd
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 16 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types: [ "published" ]

permissions:
checks: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Build
run: ./build.sh build
shell: bash

- name: Pack
run: dotnet pack -c Release -o nuget --no-build --nologo
shell: bash

- name: Publish NuGet package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push nuget/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: QdrantNupkg
path: nuget
22 changes: 6 additions & 16 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [ "published" ]
pull_request:
types:
- opened
- edited
- synchronize
- reopened

permissions:
checks: write
Expand Down Expand Up @@ -39,13 +39,3 @@ jobs:
fail_on_failure: true
require_tests: true
report_paths: '**/output/test-results/junit-*.xml'

- name: Pack
run: dotnet pack -c Release -o nuget --no-build --nologo
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: QdrantNupkg
path: nuget

0 comments on commit b3b80fd

Please sign in to comment.