-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/VisualStudioEX3/DIV2.Form…
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Workflow for test, build and publish to NuGet. | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
env: | ||
solution: DIV2.Format.Exporter.sln | ||
test_project: DIV2.Format.Exporter.Tests\DIV2.Format.Exporter.Tests.csproj | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.x | ||
|
||
- name: Install NuGet | ||
uses: NuGet/setup-nuget@v1 | ||
|
||
- name: Execute unit tests | ||
run: dotnet test $env:test_project | ||
|
||
- name: Build project | ||
run: dotnet build $env:solution --configuration Release | ||
|
||
- if: (github.ref == 'refs/heads/master') # Only publish to NuGet from master branch. | ||
name: Publish NuGet package (package is generated during the project build process) | ||
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 |