Skip to content

Commit

Permalink
Pack and release (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
s3nthilg0pal authored Dec 23, 2024
1 parent c6a2762 commit ea4fbed
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions .github/workflows/release.yml
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

0 comments on commit ea4fbed

Please sign in to comment.