Skip to content

Alex/first-version

Alex/first-version #1

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --configuration Release
- name: Pack
run: dotnet pack PromptProvider/PromptProvider.csproj -c Release -o ./artifacts
publish:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore
run: dotnet restore
- name: Pack
run: dotnet pack PromptProvider/PromptProvider.csproj -c Release -o ./artifacts
- name: Publish to NuGet
uses: NuGet/setup-nuget@v2
- name: Push package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
for pkg in ./artifacts/*.nupkg; do
dotnet nuget push "$pkg" -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json
done