-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (32 loc) · 1005 Bytes
/
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
name: Release
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'DocxTemplater.sln'
steps:
- name: echo
run: echo ${{ github.ref }}
- uses: actions/checkout@v4 #Fetch all history for all tags and branches
with:
fetch-depth: 0
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x 7.x 8.x
- name: Restore dependencies
run: nuget restore $SOLUTION
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore
- name: Run tests
run: dotnet test -c $BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Publish
if: startsWith(github.ref, 'refs/tags/v') == true
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}