image : mcr.microsoft.com/dotnet/sdk:5.0

stages:
  - build
  - test
  - release
  - deploy

build:
  stage: build
  tags: 
    - net5
  script:
    - dotnet build

test:
  stage: test
  tags: 
    - net5
  script:
    - dotnet test

release:
  stage: release
  tags: 
    - net5
  only:
    - master
  artifacts:
    paths:
      - SDK/
    expire_in: 1 week
  script:
    - dotnet publish -c Release -o ../SDK SDK/SDK.csproj

deploy:
  stage: deploy
  tags: 
    - net5
  artifacts:
    paths:
      - SDK/
    expire_in: 1 week
  script:
    - dotnet pack -c Release
    - dotnet nuget add source https://gitlab.twinzo.eu/api/v4/projects/189/packages/nuget/index.json -n gitlab_tDevkit -u gitlab+deploy-token-4 -p nidd5s9XWfRVCLGbt6cH --store-password-in-clear-text
    - dotnet nuget push "SDK/bin/Release/*.nupkg" --source gitlab_tDevkit
  only:
    - master

