Skip to content

10.3.0 - Range.For

10.3.0 - Range.For #5

name: Release to NuGet
on:
release:
types: [published]
workflow_dispatch:
inputs:
dotnetVersion:
description: "The version of .NET to use"
required: false
default: "7.0.x"
jobs:
release-to-nuget:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ github.event.inputs.dotnetVersion || '7.0.x' }}
- name: Prepare SNK file
env:
LIGHT_GUARDCLAUSES_SNK: ${{ secrets.LIGHT_GUARDCLAUSES_SNK }}
run: |
echo $LIGHT_GUARDCLAUSES_SNK | base64 --decode > ./Code/Light.GuardClauses/Light.GuardClauses.snk
- name: Create NuGet packages
run: dotnet pack ./Code/Light.GuardClauses/Light.GuardClauses.csproj -c Release /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=Light.GuardClauses.snk /p:ContinuousIntegrationBuild=true
- name: Delete SNK file
run: rm ./Code/Light.GuardClauses/Light.GuardClauses.snk
- name: Push nupkg package
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push "./Code/Light.GuardClauses/bin/Release/Light.GuardClauses.*.nupkg" --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json