Skip to content

Merge branch 'master' of github.com:Snappey/D2.Net #13

Merge branch 'master' of github.com:Snappey/D2.Net

Merge branch 'master' of github.com:Snappey/D2.Net #13

Workflow file for this run

name: Build
on:
push:
branches: [ "master" ]
tags: '**'
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Checkout
uses: actions/checkout@v1
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release
pack:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Determine version
run: echo "VERSION=$(git describe --tags --dirty --abbrev=0)" >> "$GITHUB_ENV"
- name: Pack
run: dotnet pack --output ./artifacts --configuration Release -p:Version=$VERSION
- uses: actions/upload-artifact@v1
with:
name: artifacts
path: ./artifacts
publish:
runs-on: ubuntu-latest
needs: pack
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup .NET Core 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- uses: actions/download-artifact@v1
with:
name: artifacts
path: ./artifacts
- name: Publish packages
run: dotnet nuget push ./artifacts/**.nupkg --source nuget.org --api-key ${{secrets.NUGET_TOKEN}}