Skip to content

Release Nuget Package #20

Release Nuget Package

Release Nuget Package #20

Workflow file for this run

name: Release Nuget Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'The name of the tag to release'
required: true
default: ''
jobs:
publish:
runs-on: ubuntu-latest
environment: Production
env:
TAG_NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name || github.event.release.tag_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.TAG_NAME }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Fetch latest build script from master branch
run: |
git fetch origin master
git checkout origin/master -- build.ps1
- name: Build and publish
shell: pwsh
run: ./build.ps1 ${{ env.TAG_NAME }}
env:
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} # Replace with your NuGet source (public or private)
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} # Replace with your NuGet API key (stored as secret)