-
Notifications
You must be signed in to change notification settings - Fork 3
29 lines (28 loc) · 1.15 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
name: Build and publish to the NuGet feeds
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION} ./src
- name: Test
run: dotnet test --configuration Release ./src
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} ./src/InRiver.Rest.Lib/InRiver.Rest.Lib.csproj --no-build --output .
- name: Push to the github repository
run: dotnet nuget push inRiverCommunity.Rest.Client.${VERSION}.nupkg --source https://nuget.pkg.github.com/robert-bialy/index.json --api-key ${GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push to the nuget gallery
run: dotnet nuget push inRiverCommunity.Rest.Client.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}