Skip to content

Commit

Permalink
Create workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
manfromarce authored Feb 11, 2025
1 parent cff601e commit f26c965
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build And Create Nuget Package

on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [created]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-24.04', 'windows-latest' ]

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

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

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

publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

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

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

- name: Generate packages
run: dotnet pack --no-build --configuration Release src/**/*.csproj --output ./artifacts

- name: Publish to NuGet
run: dotnet nuget push artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

0 comments on commit f26c965

Please sign in to comment.