tweak: Enable package lock files #117
This file contains 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: | |
push: | |
branches: | |
- main | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
cache: true | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Test the package | |
run: dotnet test | |
- name: Publish the package | |
run: | | |
dotnet pack -o out --configuration Release | |
cp ./.github/workflows/nuget.config ./ | |
dotnet nuget push out/*.nupkg -s GitHub --skip-duplicate | |
dotnet nuget push out/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |