-
Notifications
You must be signed in to change notification settings - Fork 50
50 lines (45 loc) · 1.28 KB
/
nuget-release.yml
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
44
45
46
47
48
49
50
name: Create NuGet and GitHub Release
on:
workflow_call:
inputs:
dotnet-version:
default: '8.0.x'
type: string
project-path:
required: true
type: string
tag-prefix:
default: ''
type: string
nuspec-file:
type: string
required: true
secrets:
github-token:
required: true
nuget-token:
required: true
jobs:
release:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
runs-on: windows-latest
environment: release
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
path: './src'
name: build
- id: release
uses: ./.github/actions/nuget-release
with:
dotnet-version: ${{ inputs.dotnet-version }}
project-path: ${{ inputs.project-path }}
tag-prefix: ${{ inputs.tag-prefix }}
nuget-directory: ${{ inputs.project-path }}/nuget
nuget-token: ${{ secrets.nuget-token }}
github-token: ${{ secrets.github-token }}
nuspec-file: ${{ inputs.nuspec-file }}