-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.05 KB
/
nuget.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
name: nuget
on:
release:
types: [ published ]
tags:
- v*
jobs:
nuget:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
SOLUTION_PATH: ./src/6.0/
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build $SOLUTION_PATH -c Release
- name: Test
run: dotnet test $SOLUTION_PATH -c Release --no-build
- name: Pack nugets
run: |
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo VERSION=$VERSION
dotnet pack $SOLUTION_PATH -c Release --no-build --output . /p:Version=$VERSION
- name: Push to NuGet
run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_ORG_API_KEY}} --source https://api.nuget.org/v3/index.json