Skip to content

Merge pull request #6 from wannaphong/copilot/make-package-to-nuget #18

Merge pull request #6 from wannaphong/copilot/make-package-to-nuget

Merge pull request #6 from wannaphong/copilot/make-package-to-nuget #18

Workflow file for this run

name: .NET Core
on: [push]
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: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Pack NuGet package
run: dotnet pack thainlp/Thainlp.csproj --configuration Release --no-build --output ./nupkg
- name: Upload NuGet package artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: ./nupkg/*.nupkg
- name: Publish to NuGet
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
continue-on-error: true