Update main.yml #15
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
# This is a basic workflow to help you get started with Actions | |
name: PublishToNuget | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build dotnet | |
run: dotnet build MimeBank.sln --configuration release | |
- name: Run Tests | |
run: dotnet test --configuration Release --no-build --verbosity normal --logger:"nunit;LogFilePath=test-result.xml" | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
test-result.xml | |
- name: Package nuget | |
run: dotnet pack MimeBank.sln --configuration release | |
- uses: brandedoutcast/[email protected] | |
with: | |
# Filepath of the project to be packaged, relative to root of repository | |
PROJECT_FILE_PATH: MimeBank | |
# NuGet package id, used for version detection & defaults to project name | |
PACKAGE_NAME: MimeBank | |
# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH | |
VERSION_STATIC: 2.0.0 | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} |