Skip to content

Merge pull request #22 from NavneetHegde/add_gitaction_workflow #10

Merge pull request #22 from NavneetHegde/add_gitaction_workflow

Merge pull request #22 from NavneetHegde/add_gitaction_workflow #10

Workflow file for this run

name: Build and Publish Nuget
on:
push:
branches:
- release/*
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
id-token: write # enable GitHub OIDC token issuance for this job
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Pack
run: dotnet pack --configuration Release --no-build --output ./nupkg
- name: Nuget Login (OIDC + temp API Key)
uses: Nuget/login@v1
id: login
with:
user: ${{secrets.NUGET_USER}}
- name: Nuget push
run: dotnet nuget push nupkg/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json