Skip to content

Publish to NuGet

Publish to NuGet #26

Workflow file for this run

name: Publish SearchExtensions package to NuGet
on:
release:
types: [created]
branches:
- gha-nuget-test
jobs:
build-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: NinjaNye.SearchExtensions
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --verbosity minimal
deploy_searchextensions:
needs: [build-and-test]
runs-on: ubuntu-latest
defaults:
run:
working-directory: NinjaNye.SearchExtensions
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Log
run: ls -al .
- name: Pack
run: dotnet pack NinjaNye.SearchExtensions.csproj -c Release --output nuget-packages
- 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
deploy_levenshtein:
needs: [build-and-test]
runs-on: ubuntu-latest
defaults:
run:
working-directory: NinjaNye.SearchExtensions.Levenshtein
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Log
run: ls -al .
- name: Pack
run: dotnet pack NinjaNye.SearchExtensions.Levenshtein.csproj -c Release --output nuget-packages
- 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
deploy_soundex:
needs: [build-and-test]
runs-on: ubuntu-latest
defaults:
run:
working-directory: NinjaNye.SearchExtensions.Soundex
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Pack
run: dotnet pack NinjaNye.SearchExtensions.Soundex.csproj -c Release -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} --output nuget-packages
- 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