-
Notifications
You must be signed in to change notification settings - Fork 24
43 lines (41 loc) · 1.43 KB
/
packages.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
name: Build, Test & Package
on:
push:
branches:
- main
paths-ignore:
- 'docs/**' # Don't run workflow when files are only in the /docs directory
jobs:
build-ubuntu:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v1
- name: .NET Build
run: dotnet build Build.csproj -c Release --nologo /p:CI=true
- name: .NET Test
run: dotnet test Build.csproj -c Release --no-build --nologo /p:CI=true
build-windows:
needs: build-ubuntu
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET SDK
uses: actions/setup-dotnet@v1
- name: .NET Build
run: dotnet build Build.csproj -c Release --nologo /p:CI=true
- name: .NET Test
run: dotnet test Build.csproj -c Release --no-build --nologo /p:CI=true
- name: .NET Pack
run: dotnet pack Build.csproj --no-build -c Release --nologo /p:PackageOutputPath=${env:GITHUB_WORKSPACE}\.nupkgs /p:CI=true
- name: Push to MyGet
run: dotnet nuget push ${env:GITHUB_WORKSPACE}\.nupkgs\*.nupkg -s https://www.myget.org/F/stackoverflow/api/v2/package -k ${{ secrets.MYGET_API_KEY }}