-
Notifications
You must be signed in to change notification settings - Fork 27
29 lines (28 loc) · 1.07 KB
/
release.yml
File metadata and controls
29 lines (28 loc) · 1.07 KB
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: "Nuget Release"
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: 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: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
- name: Push to Github Packages
run: dotnet nuget push Plex.Api.${VERSION}.nupkg -s https://nuget.pkg.github.com/jensenkd/index.json -k ${GITHUB_TOKEN}
- name: Push to Nuget.Org
run: dotnet nuget push Plex.Api.${VERSION}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}