Commit afae4672 authored by Matija Obreza's avatar Matija Obreza

CI build configuration

- publish to nuget
parent f7aacf0d
stages:
- compile
- publish
build branch:
stage: compile
image: mcr.microsoft.com/dotnet/core/sdk:3.1
before_script:
# - echo "Hi"
- cd src/GRINGlobal.Client
- dotnet restore
script:
- dotnet build /p:Version=0.0 -c Release --no-restore --version-suffix ${CI_COMMIT_REF_SLUG}
- find bin/
artifacts:
name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 day
paths:
- src/GRINGlobal.Client/bin/*
except:
- /^v\d\./
publish to nuget:
stage: publish
image: mcr.microsoft.com/dotnet/core/sdk:3.1
before_script:
- cd src/GRINGlobal.Client
- dotnet restore
- if [[ "${CI_COMMIT_TAG}" =~ ^v[0-9] ]] ; then
export VERSION=`echo "${CI_COMMIT_TAG}" | sed -E 's/v(.*\..*)/\1/'`;
else
echo "Invalid version format ${CI_COMMIT_TAG}";
exit -1;
fi
script:
- dotnet build /p:Version=${VERSION} -c Release --no-restore
- dotnet pack /p:Version=${VERSION} -c Release --no-restore --no-build
- cat obj/Release/GRINGlobal.Client.${VERSION}.nuspec
- dotnet nuget push bin/Release/GRINGlobal.Client.${VERSION}.nupkg -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json
only:
- /^v\d\./
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment