-
Notifications
You must be signed in to change notification settings - Fork 26
53 lines (44 loc) · 1.48 KB
/
publish_dapper.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
51
52
53
name: Publish Tiny Helpers for Dapper on NuGet
on:
push:
branches: [ master ]
paths: [ 'src/TinyHelpers.Dapper/**' ]
workflow_dispatch:
env:
NET_VERSION: '8.x'
PROJECT_NAME: src/TinyHelpers.Dapper
PROJECT_FILE: TinyHelpers.Dapper.csproj
TAG_NAME: dapper
RELEASE_NAME: TinyHelpers.Dapper
jobs:
publish:
name: Publish on NuGet
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET SDK ${{ env.NET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.NET_VERSION }}
dotnet-quality: 'ga'
- name: Nerdbank.GitVersioning
uses: dotnet/[email protected]
id: nbgv
with:
path: ${{ env.PROJECT_NAME }}
- name: Package
run: dotnet pack -c Release -o . '${{ env.PROJECT_NAME }}/${{ env.PROJECT_FILE }}'
- name: Publish on NuGet
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}_v${{ steps.nbgv.outputs.NuGetPackageVersion }}
release_name: ${{ env.RELEASE_NAME }} ${{ steps.nbgv.outputs.NuGetPackageVersion }}
draft: false
prerelease: false