Skip to content

Merge pull request #33 from marthijn/feature/dotnet9 #30

Merge pull request #33 from marthijn/feature/dotnet9

Merge pull request #33 from marthijn/feature/dotnet9 #30

Workflow file for this run

name: release
on:
workflow_dispatch:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-preview"
env:
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget/release
jobs:
build:
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
matrix:
dotnet-version: [ '9.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Set RELEASE_VERSION variable from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print release version
run: |
echo $RELEASE_VERSION
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release /p:Version=${RELEASE_VERSION}
- name: Test
run: dotnet test --configuration Release /p:Version=${RELEASE_VERSION} --no-build
- name: Pack
run: dotnet pack --configuration Release /p:Version=${RELEASE_VERSION} --output ${{ env.NuGetDirectory }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Push
run: dotnet nuget push ${{ env.NuGetDirectory }}/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}