Skip to content

Update release-package.yml #9

Update release-package.yml

Update release-package.yml #9

name: .NET Core CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish
run: dotnet publish --no-build -c Release -o ./publish
- name: Pack
run: dotnet pack --no-build -c Release -o ./nupkg
- name: Push
run: dotnet nuget push "./nupkg/*.nupkg" --api-key ${{ secrets.PUBLISH_TO_GITHUB }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
- name: PushToNuget
run: dotnet nuget push "./nupkg/*.nupkg" -k ${{ secrets.PUBLISH_TO_NUGET }} -s https://api.nuget.org/v3/index.json