Add NS2.0 and bit of cleanup around. #235
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
env: | |
CONFIGURATION: Release | |
DOTNET_VERSION: 8.0.x | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: CI version suffix | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
run: echo 'VERSION_SUFFIX=ci-${{ github.run_id }}' >> $GITHUB_ENV | |
- name: Release version suffix | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: echo 'VERSION_SUFFIX=' >> $GITHUB_ENV | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Build | |
run: dotnet build -c ${{ env.CONFIGURATION }} --version-suffix '${{ env.VERSION_SUFFIX }}' | |
- name: Test | |
run: dotnet test -c ${{ env.CONFIGURATION }} --no-build --verbosity normal --logger 'GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true' | |
- name: Pack | |
run: dotnet pack -c ${{ env.CONFIGURATION }} --no-build --version-suffix '${{ env.VERSION_SUFFIX }}' | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: | | |
**/*.nupkg | |
**/*.snupkg | |
publish: | |
needs: ci | |
if: ${{ github.repository == 'ssone95/ChromaDB.Client' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Download | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
- name: Publish to NuGet.org | |
run: dotnet nuget push '**/*.nupkg' --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |