Skip to content

Workflow file for this run

name: Build and Publish NuGet Package
on:
push:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.x'
- name: Go To Right Folder
run: ls -la && cd Source/Furesoft.PrattParser
- name: Install dependencies
run: dotnet restore
- name: Build and package
run: |
dotnet build -c Release
dotnet pack -c Release -o ./nuget
- name: Publish to NuGet
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: ./nuget/*.nupkg
- name: Publish to GitHub Packages
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package
run: |
dotnet nuget push ./nuget/*.nupkg -s https://nuget.pkg.github.com/${GITHUB_OWNER}/index.json -k ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_OWNER: ${{ github.repository_owner }}