Skip to content

1.1.0

1.1.0 #3

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Release to NuGet
on:
release:
types: [published]
workflow_dispatch:
env:
SOLUTION_NAME: Distractive.Formatters.sln
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Set up dependency caching for faster builds
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
run: dotnet restore "$SOLUTION_NAME"
- name: Build
run: dotnet build "$SOLUTION_NAME" -c Release --no-restore
- name: Test
run: dotnet test "$SOLUTION_NAME" -c Release --no-build --verbosity normal
- name: Pack
run: dotnet pack "$SOLUTION_NAME" -c Release --no-build --output .
- name: Publish to nuget.org
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json