Skip to content

Version 5.0.0

Version 5.0.0 #33

Workflow file for this run

name: Release to NuGet
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
- uses: actions/cache@v4
id: cache-nuget-uheadless
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-uheadless
- 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 -c Release --no-build /p:Version=${VERSION}
working-directory: ./
- name: Pack nugets
run: dotnet pack -c Release --no-build --output ./releases /p:Version=${VERSION}
working-directory: ./
- name: Push (Nikcio.UHeadless) to NuGet
run: dotnet nuget push "Nikcio.UHeadless.${VERSION}.nupkg" --api-key ${{secrets.NUGET_API_TOKEN}} --source https://api.nuget.org/v3/index.json
working-directory: ./releases