Skip to content

1.0.16

1.0.16 #9

Workflow file for this run

name: CI/CD
on:
release:
types:
- created
env:
PROJECT_PATH: 'Paytrail-dotnet-sdk/Paytrail-dotnet-sdk.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}/output/
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
jobs:
build:
name: Run unit tests
runs-on: ubuntu-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 Paytrail-dotnet-sdk.UnitTest/Paytrail-dotnet-sdk.UnitTest.csproj
- name: Build
run: dotnet build Paytrail-dotnet-sdk.UnitTest/Paytrail-dotnet-sdk.UnitTest.csproj --configuration Release --no-restore
- name: Test
run: dotnet test Paytrail-dotnet-sdk.UnitTest/Paytrail-dotnet-sdk.UnitTest.csproj --configuration Release --no-build
continue-on-error: true
deploy:
name: Publish Nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore packages
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Build project
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release
- name: Pack project
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: Push package
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE_URL }}