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

stages:
  - build
  - test
  - release
  - deploy

build:
  stage: build
  script:
    - dotnet build

test:
  stage: test
  script:
    - dotnet test

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

deploy:
  stage: deploy
  artifacts:
    paths:
      - Main/
    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 lorant.bugar -p Yx5G3Xnp-QnVsCo4FwyJ --store-password-in-clear-text
    - dotnet nuget push "Main/bin/Release/*.nupkg" --source gitlab_tDevkit
  only:
    - master

