Skip to content

Commit

Permalink
Merge pull request #23 from GeorgKreuzmayr/feature/travis
Browse files Browse the repository at this point in the history
Feature/travis
  • Loading branch information
fgather authored Oct 4, 2020
2 parents 1275a73 + 4f5f5b4 commit 22a6ca5
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 26 deletions.
32 changes: 22 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
language: csharp
mono: none
dotnet: 2.2.402
solution: ArchUnit.sln
script: chmod +x ./Travis/build.sh && ./Travis/build.sh
deploy:
skip_cleanup: true
provider: script
script: chmod +x ./Travis/deploy.sh && ./Travis/deploy.sh $NUGET_API_KEY $NUGET_SOURCE
on:
tags: true
all_branches: true
jobs:
include:
- stage: linux_build
dotnet: 2.2.402
mono: none
os: linux
script: chmod +x ./Travis/test_linux.sh && ./Travis/test_linux.sh
- stage: windows_build
mono: none
os: windows
before_script:
- choco install dotnetcore-sdk --version=2.2.402
- PowerShell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned'
script:
- PowerShell -File Travis/test_windows.ps1 -tag "$TRAVIS_TAG"
deploy:
skip_cleanup: true
provider: script
script: PowerShell -File Travis/deploy.ps1 -apiKey $NUGET_API_KEY -source $NUGET_SOURCE -tag "$TRAVIS_TAG"
on:
tags: true
all_branches: true
2 changes: 1 addition & 1 deletion ArchUnitNET.NUnit/ArchUnitNET.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
<IsPackable>true</IsPackable>
<Title>ArchUnit C# NUnit Extension</Title>
<Authors>Florian Gather, Fritz Brandhuber</Authors>
Expand Down
2 changes: 1 addition & 1 deletion ArchUnitNET.xUnit/ArchUnitNET.xUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
<IsPackable>true</IsPackable>
<Title>ArchUnit C# xUnit Extension</Title>
<Authors>Florian Gather, Fritz Brandhuber</Authors>
Expand Down
4 changes: 2 additions & 2 deletions ArchUnitNET/ArchUnitNET.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
<IsPackable>true</IsPackable>
<RootNamespace>ArchUnitNET</RootNamespace>
<PackageId>TngTech.ArchUnitNET</PackageId>
Expand All @@ -27,4 +27,4 @@
<None Remove="License.md" />
</ItemGroup>

</Project>
</Project>
6 changes: 0 additions & 6 deletions Travis/build.sh

This file was deleted.

14 changes: 8 additions & 6 deletions Travis/deploy.sh → Travis/deploy.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
ApiKey=$1
Source=$2
param(
[string]$apiKey,
[string]$source,
[string]$tag
)

dotnet nuget push ./ArchUnitNET/nupkgs/TngTech.ArchUnitNET.*.nupkg -k $ApiKey -s $Source
dotnet nuget push ./ArchUnitNET.xUnit/nupkgs/TngTech.ArchUnitNET.xUnit.*.nupkg -k $ApiKey -s $Source
dotnet nuget push ./ArchUnitNET.NUnit/nupkgs/TngTech.ArchUnitNET.NUnit.*.nupkg -k $ApiKey -s $Source
dotnet nuget push ./ArchUnitNET/nupkgs/TngTech.ArchUnitNET.*.nupkg -k $apiKey -s $source
dotnet nuget push ./ArchUnitNET.xUnit/nupkgs/TngTech.ArchUnitNET.xUnit.*.nupkg -k $apiKey -s $source
dotnet nuget push ./ArchUnitNET.NUnit/nupkgs/TngTech.ArchUnitNET.NUnit.*.nupkg -k $apiKey -s $source
3 changes: 3 additions & 0 deletions Travis/test_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -ev
dotnet test -c Release --framework netcoreapp2.2
21 changes: 21 additions & 0 deletions Travis/test_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
param(
[string]$tag
)
New-Variable -Name "VERSION_PATTERN" -Value "^[0-9]+\.[0-9]+\.[0-9]"

dotnet build -c Release

if("$tag" -eq "")
{
dotnet pack -c Release --output nupkgs -p:PackageVersion="0.0.0" -p:AssemblyVersion="0.0.0.0"
}
elseif ("$tag" -match $VERSION_PATTERN)
{
dotnet pack -c Release --output nupkgs -p:PackageVersion="$tag" -p:AssemblyVersion="$tag.0"
}
else
{
Write-Output "Git Tag has to resemble a package version (e.g. 1.0.0)."
exit 1
}
dotnet test -c Release

0 comments on commit 22a6ca5

Please sign in to comment.