Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
José Miguel Sánchez Fernández committed Feb 13, 2021
2 parents 2b991f7 + 4681ef8 commit eac7d58
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
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

0 comments on commit eac7d58

Please sign in to comment.