Skip to content

Workflow file for this run

name: Publish SearchExtensions package to NuGet
on:
push:
branches:
- gha-nuget-test
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Restore dependencies
run: dotnet restore
working-directory: NinjaNye.SearchExtensions
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: NinjaNye.SearchExtensions
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-output
path: NinjaNye.SearchExtensions/bin/Release
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Test
run: dotnet test --verbosity normal
working-directory: NinjaNye.SearchExtensions.Tests
deploy:
needs: [build, test]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-output
- name: Pack
run: dotnet pack -c Release --no-build --output nuget-packages
working-directory: NinjaNye.SearchExtensions
- name: Log
run: ls -al ./nuget-packages
# - name: Push to NuGet
# run: dotnet nuget push ./nuget-packages/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate