publish new NuGet package v2.2.0 #27
Workflow file for this run
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: run-tests-create-and-push-nuget-package | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
env: | |
PROJECT_PATH: 'src/IegTools.FluentPollster/IegTools.FluentPollster.csproj' | |
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output | |
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
dotnet-version: [ '7.0.x' ] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Setup Nuget | |
uses: Nuget/setup-nuget@v1.0.5 | |
- name: Restore nuget packages | |
run: nuget restore 'IegTools.FluentPollster.sln' | |
- name: 'Install dependencies' | |
run: dotnet restore ${{ env.PROJECT_PATH }} | |
- name: 'Build project' | |
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release | |
- name: 'Test project' | |
run: dotnet test --no-restore --verbosity normal | |
- name: 'Get Version' | |
uses: bbonkr/get-version-action@v1.0.4 | |
id: get_version | |
with: | |
project: ${{ env.PROJECT_PATH }} | |
- name: 'Pack project' | |
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release -p:PackageVersion=${{ steps.get_version.outputs.version }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }} | |
- name: 'Push package' | |
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_OPEN_SOURCE }} -s ${{ env.NUGET_SOURCE_URL }} --skip-duplicate |