Skip to content

Commit eac7d58

Browse files
author
José Miguel Sánchez Fernández
committed
2 parents 2b991f7 + 4681ef8 commit eac7d58

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Workflow for test, build and publish to NuGet.
2+
name: Build
3+
4+
on:
5+
push:
6+
branches: [ master, develop ]
7+
pull_request:
8+
branches: [ master, develop ]
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
14+
env:
15+
solution: DIV2.Format.Exporter.sln
16+
test_project: DIV2.Format.Exporter.Tests\DIV2.Format.Exporter.Tests.csproj
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Install .NET Core
25+
uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: 3.1.x
28+
29+
- name: Install NuGet
30+
uses: NuGet/setup-nuget@v1
31+
32+
- name: Execute unit tests
33+
run: dotnet test $env:test_project
34+
35+
- name: Build project
36+
run: dotnet build $env:solution --configuration Release
37+
38+
- if: (github.ref == 'refs/heads/master') # Only publish to NuGet from master branch.
39+
name: Publish NuGet package (package is generated during the project build process)
40+
run: dotnet nuget push "DIV2.Format.Exporter\bin\x64\Release\*.nupkg" --api-key ${{ secrets.NUGET_SECRET_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate --no-symbols true

0 commit comments

Comments
 (0)