Skip to content

Commit 22a6ca5

Browse files
authored
Merge pull request #23 from GeorgKreuzmayr/feature/travis
Feature/travis
2 parents 1275a73 + 4f5f5b4 commit 22a6ca5

File tree

8 files changed

+58
-26
lines changed

8 files changed

+58
-26
lines changed

.travis.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
language: csharp
2-
mono: none
3-
dotnet: 2.2.402
42
solution: ArchUnit.sln
5-
script: chmod +x ./Travis/build.sh && ./Travis/build.sh
6-
deploy:
7-
skip_cleanup: true
8-
provider: script
9-
script: chmod +x ./Travis/deploy.sh && ./Travis/deploy.sh $NUGET_API_KEY $NUGET_SOURCE
10-
on:
11-
tags: true
12-
all_branches: true
3+
jobs:
4+
include:
5+
- stage: linux_build
6+
dotnet: 2.2.402
7+
mono: none
8+
os: linux
9+
script: chmod +x ./Travis/test_linux.sh && ./Travis/test_linux.sh
10+
- stage: windows_build
11+
mono: none
12+
os: windows
13+
before_script:
14+
- choco install dotnetcore-sdk --version=2.2.402
15+
- PowerShell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned'
16+
script:
17+
- PowerShell -File Travis/test_windows.ps1 -tag "$TRAVIS_TAG"
18+
deploy:
19+
skip_cleanup: true
20+
provider: script
21+
script: PowerShell -File Travis/deploy.ps1 -apiKey $NUGET_API_KEY -source $NUGET_SOURCE -tag "$TRAVIS_TAG"
22+
on:
23+
tags: true
24+
all_branches: true

ArchUnitNET.NUnit/ArchUnitNET.NUnit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
55
<IsPackable>true</IsPackable>
66
<Title>ArchUnit C# NUnit Extension</Title>
77
<Authors>Florian Gather, Fritz Brandhuber</Authors>

ArchUnitNET.xUnit/ArchUnitNET.xUnit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
55
<IsPackable>true</IsPackable>
66
<Title>ArchUnit C# xUnit Extension</Title>
77
<Authors>Florian Gather, Fritz Brandhuber</Authors>

ArchUnitNET/ArchUnitNET.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;net48</TargetFrameworks>
55
<IsPackable>true</IsPackable>
66
<RootNamespace>ArchUnitNET</RootNamespace>
77
<PackageId>TngTech.ArchUnitNET</PackageId>
@@ -27,4 +27,4 @@
2727
<None Remove="License.md" />
2828
</ItemGroup>
2929

30-
</Project>
30+
</Project>

Travis/build.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#!/usr/bin/env bash
2-
ApiKey=$1
3-
Source=$2
1+
param(
2+
[string]$apiKey,
3+
[string]$source,
4+
[string]$tag
5+
)
46

5-
dotnet nuget push ./ArchUnitNET/nupkgs/TngTech.ArchUnitNET.*.nupkg -k $ApiKey -s $Source
6-
dotnet nuget push ./ArchUnitNET.xUnit/nupkgs/TngTech.ArchUnitNET.xUnit.*.nupkg -k $ApiKey -s $Source
7-
dotnet nuget push ./ArchUnitNET.NUnit/nupkgs/TngTech.ArchUnitNET.NUnit.*.nupkg -k $ApiKey -s $Source
7+
dotnet nuget push ./ArchUnitNET/nupkgs/TngTech.ArchUnitNET.*.nupkg -k $apiKey -s $source
8+
dotnet nuget push ./ArchUnitNET.xUnit/nupkgs/TngTech.ArchUnitNET.xUnit.*.nupkg -k $apiKey -s $source
9+
dotnet nuget push ./ArchUnitNET.NUnit/nupkgs/TngTech.ArchUnitNET.NUnit.*.nupkg -k $apiKey -s $source

Travis/test_linux.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -ev
3+
dotnet test -c Release --framework netcoreapp2.2

Travis/test_windows.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
param(
2+
[string]$tag
3+
)
4+
New-Variable -Name "VERSION_PATTERN" -Value "^[0-9]+\.[0-9]+\.[0-9]"
5+
6+
dotnet build -c Release
7+
8+
if("$tag" -eq "")
9+
{
10+
dotnet pack -c Release --output nupkgs -p:PackageVersion="0.0.0" -p:AssemblyVersion="0.0.0.0"
11+
}
12+
elseif ("$tag" -match $VERSION_PATTERN)
13+
{
14+
dotnet pack -c Release --output nupkgs -p:PackageVersion="$tag" -p:AssemblyVersion="$tag.0"
15+
}
16+
else
17+
{
18+
Write-Output "Git Tag has to resemble a package version (e.g. 1.0.0)."
19+
exit 1
20+
}
21+
dotnet test -c Release

0 commit comments

Comments
 (0)