Merge branch 'master' of github.com:Snappey/D2.Net #13
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
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}} |