From a18cea95aa7c002059891e95e3b4613ff9def47a Mon Sep 17 00:00:00 2001 From: Matthias Langhard Date: Tue, 2 Nov 2021 10:50:10 +0100 Subject: [PATCH] chore: adds CI configuration --- .gitlab-ci.yml | 18 ++++++++++++++++++ pack.sh | 2 ++ publish.sh | 8 ++++++++ src/Cli/Cli.csproj | 18 +++++++++++++----- 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100755 pack.sh create mode 100755 publish.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6ea242b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +stages: + - test + - publish + +running tests for tag: + image: mcr.microsoft.com/dotnet/sdk:5.0 + stage: test + script: + - dotnet test tests/EcoLogic.Auth0Api.Tests.csproj + +publish to nuget: + only: + - /^\d*.\d*.\d*$/ # gets triggered if the commit tag is in the form n.n.n where n is any number + image: mcr.microsoft.com/dotnet/sdk:5.0 + stage: publish + script: + - dotnet pack src/Cli -o ./packaged + - dotnet nuget push ./packaged/*.nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json diff --git a/pack.sh b/pack.sh new file mode 100755 index 0000000..1195ff1 --- /dev/null +++ b/pack.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +dotnet pack src/Cli -o ../local-nuget-packages \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..a1b9cd7 --- /dev/null +++ b/publish.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +dotnet pack src -o ../../local-nuget-packages +unset -v latest +for file in "../local-nuget-packages"/*; do + [[ $file -nt $latest ]] && latest=$file +done +echo "$latest" +dotnet nuget push "$latest" -k "$NUGET_API_KEY" -s https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/src/Cli/Cli.csproj b/src/Cli/Cli.csproj index f1ed9af..ebca526 100644 --- a/src/Cli/Cli.csproj +++ b/src/Cli/Cli.csproj @@ -6,19 +6,27 @@ Cli true update-tag + Novaloop.UpdateTag + Updates the tag of a repo to the next chosen version according the semver symantic. + semver;update-tag;tag;git + 0.1.0 + Matthias Langhard + Novaloop AG + https://gitlab.com/novaloop-oss/novaloop.updatetag + - - - + + + - - + +