-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (28 loc) · 925 Bytes
/
publish.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
name: Publish
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore ".\src"
- name: Build
run: dotnet build ".\src" --configuration Release --no-restore
- name: Test
run: dotnet test ".\src" --no-restore --verbosity normal
- name: Set Version from Tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Pack
run: dotnet pack ./src/Aycblok/Aycblok.csproj --configuration Release --output out
- name: Push
run: dotnet nuget push ./out/MPewsey.Aycblok.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ secrets.NUGET_API_KEY }}