Skip to content

Commit

Permalink
Add artifact creation and distribution (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
FObermaier authored Feb 16, 2022
1 parent 2388883 commit a58b09c
Showing 1 changed file with 68 additions and 6 deletions.
74 changes: 68 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: .NET

on:
push:
branches: [ develop ]
tags-ignore:
- '**'
pull_request:
branches: [ develop ]

jobs:
build:
pack:

runs-on: ubuntu-latest
services:
Expand All @@ -33,9 +33,71 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Restore dependencies
run: dotnet restore NetTopologySuite.IO.Oracle.sln
run: dotnet restore

- name: Build
run: dotnet build NetTopologySuite.IO.Oracle.sln --no-restore
run: dotnet build -c Release -v minimal -p:WarningLevel=3

- name: Test
run: dotnet test NetTopologySuite.IO.Oracle.sln --no-build --verbosity normal
run: dotnet test -c Release --no-build -v normal

- name: Pack
run: dotnet pack -c Release --no-build -o artifacts -p:NoWarn=NU5105

- name: Upload
uses: actions/upload-artifact@v2
with:
name: NuGet Package Files (ubuntu-latest)
path: artifacts

deployToMyGet:
name: Deploy to MyGet
runs-on: ubuntu-latest

needs: pack
if: github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Download Package Files
uses: actions/download-artifact@v2
with:
name: NuGet Package Files (ubuntu-latest)
path: artifacts

- name: Publish Package Files to MyGet
run: dotnet nuget push artifacts/*.nupkg -s https://www.myget.org/F/nettopologysuite/api/v3/index.json -k $MYGET_API_KEY
shell: bash
env:
MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }}

deployToNuGet:
name: Deploy to NuGet
runs-on: ubuntu-latest

needs: pack
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x

- name: Download Package Files
uses: actions/download-artifact@v2
with:
name: NuGet Package Files (ubuntu-latest)
path: artifacts

- name: Publish Package Files to NuGet
run: dotnet nuget push artifacts/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY
shell: bash
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

0 comments on commit a58b09c

Please sign in to comment.