Skip to content

Enhance .NET workflow with branch and tag support #91

Enhance .NET workflow with branch and tag support

Enhance .NET workflow with branch and tag support #91

Workflow file for this run

name: Build and deploy
on:
push:
branches:
- main
- develop
tags:
- 'release/v*'
pull_request: {}
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --no-build --configuration Release PAYNLSDK/PayNLSdk.csproj --output .
- name: Push Nuget
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/release/v') }}
env:
NUGET_API_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
run: |
dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate
dotnet nuget push *.snupkg --source https://api.nuget.org/v3/index.json --api-key "$NUGET_API_KEY" --skip-duplicate