Skip to content

Commit

Permalink
Merge pull request #18 from pfpack/feature/create-ci-cd
Browse files Browse the repository at this point in the history
Create dotnet.yml
  • Loading branch information
andreise authored Aug 8, 2021
2 parents d1f8b5c + be31e2f commit 7cabf94
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: .NET

on:
push:
branches: [ master ]

pull_request:
branches: [ master ]

release:
types: [ published ]
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

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

- name: Create Local NuGet Directory
run: mkdir ~/nuget

- name: Add Local Nuget Source
run: dotnet nuget add source ~/nuget

- name: Restore Primitives
run: dotnet restore ./src/*/*/Primitives.csproj

- name: Build Primitives
run: dotnet build ./src/*/*/Primitives.csproj --no-restore -c Release

- name: Pack Primitives
run: dotnet pack ./src/*/*/Primitives.csproj --no-restore -o ~/nuget -c Release

- name: Restore Primitives.Tests
run: dotnet restore ./src/*/*/Primitives.Tests.csproj

- name: Test Primitives.Tests
run: dotnet test ./src/*/*/Primitives.Tests.csproj --no-restore -c Release

- name: Push Packages
if: ${{ github.event_name == 'release' }}
run: dotnet nuget push "../../../nuget/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetSourcePassword }} --skip-duplicate

0 comments on commit 7cabf94

Please sign in to comment.