-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (52 loc) · 1.4 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin '+refs/heads/*:refs/remotes/origin/*'
git branch --remote --contains | grep origin/master
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack
run: |
dotnet pack src \
-p:PackageVersion="${VERSION}" \
--configuration Release \
--verbosity normal \
--output .
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nupkg
path: |
*.nupkg
*.snupkg
deploy-nuget:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v1
with:
name: nupkg
- name: Push to NuGet
run: |
dotnet nuget push ./nupkg/* \
--source ${FEED_URL} \
--api-key ${FEED_KEY} \
--skip-duplicate
env:
FEED_URL: https://api.nuget.org/v3/index.json
FEED_KEY: ${{ secrets.NUGET_KEY }}