Skip to content

Commit

Permalink
add dotnet workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
R0boC0p committed May 22, 2024
1 parent 47fbd4e commit e6b2f36
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: .NET

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
dotnet-version: ["6.0.x", "7.0.x", "8.0.x"]

steps:
- uses: actions/checkout@v4

- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal

- name: Pack
run: dotnet pack --no-build -o ./nupkg

- name: Push NuGet package to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: dotnet nuget push ./nupkg/*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key $GITHUB_TOKEN

0 comments on commit e6b2f36

Please sign in to comment.