Added support for multiple .NET Core frameworks #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NuGet Package | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
# Add explicit permissions | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Debug Event | |
run: | | |
echo "Event name: ${{ github.event_name }}" | |
echo "Event action: ${{ github.event.action }}" | |
echo "Release tag: ${{ github.event.release.tag_name }}" | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.release.tag_name }} # Explicitly checkout the tag | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: | | |
7.0.X | |
8.0.x | |
9.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
- name: Pack | |
run: dotnet pack --configuration Release --no-build | |
- name: List packages | |
run: find . -name "*.nupkg" | sort | |
- name: Push to GitHub Packages | |
run: dotnet nuget push "**/*.nupkg" --source https://nuget.pkg.github.com/tomas-rampas/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate |