Skip to content

Version 1.0.1

Version 1.0.1 #3

Workflow file for this run

name: Release to NuGet
on:
release:
types: [ published ]
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
cache: true
cache-dependency-path: 'Directory.Packages.props'
- name: Restore dependencies
run: dotnet restore
working-directory: ./
- name: Build
run: dotnet build -c Release --no-restore /p:Version=${VERSION}
working-directory: ./
- name: Test
run: dotnet test --no-build -c Release --verbosity normal /p:Version=${VERSION}
working-directory: ./
- name: Pack nugets
run: dotnet pack -c Release --no-build --output ./releases /p:Version=${VERSION}
working-directory: ./
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Push (Nikcio.OpenApiCodeGen) to NuGet
run: dotnet nuget push "Nikcio.OpenApiCodeGen.${VERSION}.nupkg" --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
working-directory: ./releases