-
Notifications
You must be signed in to change notification settings - Fork 27
43 lines (35 loc) · 1.12 KB
/
Copy pathrelease.yml
File metadata and controls
43 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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)