-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.04 KB
/
Copy pathBuildDeploy.yml
File metadata and controls
36 lines (31 loc) · 1.04 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
30
31
32
33
34
35
36
name: BuildDeploy
on:
push:
tags: releases/[0-9]+.[0-9]+.[0-9]+*
branches: [ master ]
pull_request:
branches: [ master ]
env:
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output
NUGET_SOURCE_URL: 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
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack Project
if: startsWith( github.ref, 'refs/tags/releases/')
run: dotnet pack FunkyBasics/FunkyBasics.csproj --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Push Package
if: startsWith( github.ref, 'refs/tags/releases/')
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg --api-key ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }}