dotnet-cqrs/.github/workflows/dotnet.yml

37 lines
1002 B
YAML
Raw Normal View History

2023-11-04 16:12:16 -04:00
# 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
2023-11-04 16:16:06 -04:00
name: Publish NuGets
2023-11-04 16:12:16 -04:00
on:
2023-11-04 16:16:06 -04:00
release:
types:
- published
2023-11-04 16:12:16 -04:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2023-11-04 16:16:06 -04:00
- name: Extract Release Version
id: extract_version
run: echo ::set-output name=release_version::${{ github.event.release.tag_name }}
2023-11-04 16:12:16 -04:00
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore
- name: Build and Pack NuGet Package
run: dotnet pack -c Release -o ./artifacts
- name: Publish to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --source https://nuget.pkg.github.com/singatias/index.json --api-key ${{ secrets.NUGET_API_KEY }}
2023-11-04 16:16:06 -04:00
env:
NUGET_VERSION: ${{ steps.extract_version.outputs.release_version }}