Skip to content

Merge pull request #88 from Ocean-Signal/feature/safety-related-broad… #81

Merge pull request #88 from Ocean-Signal/feature/safety-related-broad…

Merge pull request #88 from Ocean-Signal/feature/safety-related-broad… #81

Workflow file for this run

name: Build
on:
push:
pull_request:
release:
types:
- published
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:Version=$GITVERSION_NUGETVERSION
- name: Test
run: dotnet test -c Release --no-restore
- name: Pack
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:Version=$GITVERSION_NUGETVERSION -o ./artifacts
- name: Push to MyGet
run: dotnet nuget push ./artifacts/*.nupkg --source https://www.myget.org/F/aisparser/api/v3/index.json --api-key ${{ secrets.MYGET_API_KEY }}
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: artifacts/**/*
deploy:
needs: build
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Push to NuGet Feed
env:
NUGET_URL: https://api.nuget.org/v3/index.json
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./artifacts/*.nupkg --source $NUGET_URL --skip-duplicate --api-key $NUGET_API_KEY