chore: adds CI configuration

This commit is contained in:
Matthias Langhard
2021-11-02 10:50:10 +01:00
parent 69f872082d
commit a18cea95aa
4 changed files with 41 additions and 5 deletions

18
.gitlab-ci.yml Normal file
View File

@@ -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

2
pack.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
dotnet pack src/Cli -o ../local-nuget-packages

8
publish.sh Executable file
View File

@@ -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

View File

@@ -6,19 +6,27 @@
<RootNamespace>Cli</RootNamespace>
<PackAsTool>true</PackAsTool>
<ToolCommandName>update-tag</ToolCommandName>
<PackageId>Novaloop.UpdateTag</PackageId>
<title>Updates the tag of a repo to the next chosen version according the semver symantic.</title>
<PackageTags>semver;update-tag;tag;git</PackageTags>
<Version>0.1.0</Version>
<Authors>Matthias Langhard</Authors>
<Company>Novaloop AG</Company>
<PackageProjectUrl>https://gitlab.com/novaloop-oss/novaloop.updatetag</PackageProjectUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
<PackageReference Include="Spectre.Console" Version="0.42.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0"/>
<PackageReference Include="Spectre.Console" Version="0.42.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
<ProjectReference Include="..\Core\Core.csproj"/>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj"/>
</ItemGroup>
</Project>