-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.03 KB
/
middleware.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
name: Middleware CI
on:
push:
branches: [ main ]
paths: [ 'src/**' ]
tags: [ pack/* ]
env:
PROJECT_PATH: src/middleware/Polyrific.Middleware.HttpStatusTest.csproj
NUGET_FEED: https://api.nuget.org/v3/index.json
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore $PROJECT_PATH
- name: Build
run: dotnet build -c Release --no-restore $PROJECT_PATH
- name: Pack
if: startsWith( github.ref, 'refs/tags/pack/')
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[3]}"
dotnet pack -c Release --no-build --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg $PROJECT_PATH
- name: Push to NuGet
if: startsWith( github.ref, 'refs/tags/pack/')
run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{secrets.NUGET_TOKEN}}