From c77bd2906d86d4b63961577511f3827d3163c6da Mon Sep 17 00:00:00 2001 From: Farid Date: Thu, 17 Jul 2025 16:24:25 +0200 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d0602cb --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: .NET Build & Tests + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal From cf818fb0de453b34e06dd9f99d006249bdc8fe66 Mon Sep 17 00:00:00 2001 From: Farid Date: Thu, 17 Jul 2025 16:24:51 +0200 Subject: [PATCH 2/2] Create nuget.yml --- .github/workflows/nuget.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/nuget.yml diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml new file mode 100644 index 0000000..7db8b20 --- /dev/null +++ b/.github/workflows/nuget.yml @@ -0,0 +1,33 @@ +name: .NET NuGET Publish + +on: + release: + types: released + + +jobs: + nugetpush: + name: Build, test and push to NuGET + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal + - name: Publish to Nuget.org + run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_apikey }} -s https://api.nuget.org/v3/index.json + - name: Add Github Packages source + run: dotnet nuget add source --username cmdotcom --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/cmdotcom/index.json" + - name: Publish to Github Packages + run: dotnet nuget push **/*.nupkg -s github