Update pack.yaml #9
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: Build and Publish NuGet Package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x' | |
- name: Install dependencies | |
run: dotnet restore Source/Furesoft.PrattParser/Furesoft.PrattParser.csproj | |
- name: Build and package | |
run: | | |
dotnet build -c Release Source/Furesoft.PrattParser/Furesoft.PrattParser.csproj | |
dotnet pack -c Release -o ./nuget Source/Furesoft.PrattParser/Furesoft.PrattParser.csproj | |
dotnet build -c Release Source/Furesoft.PrattParser.Testing/Furesoft.PrattParser.Testing.csproj | |
dotnet pack -c Release -o ./nuget Source/Furesoft.PrattParser.Testing/Furesoft.PrattParser.Testing.csproj | |
- name: Publish to NuGet | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-package | |
path: ./nuget/*.nupkg | |
- name: Publish package To GH | |
run: | | |
dotnet nuget push ./nuget/*.nupkg -s https://nuget.pkg.github.com/${GITHUB_OWNER}/index.json -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
env: | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
- name: Publish package To Nuget | |
run: | | |
dotnet nuget push ./nuget/*.nupkg --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate |