-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6a2762
commit ea4fbed
Showing
1 changed file
with
23 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
|
||
name: Release nuget package | ||
name: Build and Release to NuGet | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'warning' | ||
type: choice | ||
options: | ||
- info | ||
- warning | ||
- debug | ||
tags: | ||
description: 'Test scenario tags' | ||
required: false | ||
type: boolean | ||
environment: | ||
description: 'Environment to run tests against' | ||
type: environment | ||
required: true | ||
|
||
jobs: | ||
log-the-inputs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- run: | | ||
echo "Log level: $LEVEL" | ||
echo "Tags: $TAGS" | ||
echo "Environment: $ENVIRONMENT" | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 9.x | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore IpApi/IpApi.csproj | ||
|
||
- name: Build the project | ||
run: dotnet build IpApi/IpApi.csproj --configuration Release --no-restore | ||
|
||
- name: Pack NuGet package | ||
run: dotnet pack IpApi/IpApi.csproj --configuration Release --no-build --output ./nupkg | ||
|
||
- name: Publish to NuGet | ||
env: | ||
LEVEL: ${{ inputs.logLevel }} | ||
TAGS: ${{ inputs.tags }} | ||
ENVIRONMENT: ${{ inputs.environment }} | ||
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
run: dotnet nuget push "./nupkg/*.nupkg" --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json |