-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (49 loc) · 1.51 KB
/
build_deploy.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
54
55
56
57
58
59
60
61
62
63
name: Build and push nuget
on:
create:
tags:
- 'v*'
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-push-nuget:
env:
BUILD_CONFIG: "Release"
SOLUTION: "IIIF.sln"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/IIIF
steps:
- name: Check out code
id: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: "5.x"
- name: Determine GitVersion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore dependencies
run: nuget restore $SOLUTION
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore -p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Pack
run: dotnet pack IIIF/IIIF.csproj --configuration $BUILD_CONFIG -p:Version=$GITVERSION_NUGETVERSION --no-restore --no-build
- name: Publish Package and Symbols
if: startsWith(github.ref, 'refs/tags/v')
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}