Skip to content

Commit 28d4910

Browse files
authored
Use GitVersion as a tool. (#68)
1 parent 106edac commit 28d4910

7 files changed

Lines changed: 37 additions & 63 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ matrix:
1313
- os: linux
1414
dist: xenial
1515
sudo: required
16-
dotnet: 2.2.101
16+
dotnet: 2.2
1717
- os: osx
1818
osx_image: xcode9 # OSX 10.12
19-
dotnet: 2.2.101
19+
dotnet: 2.2.104
2020
before_install:
2121
- ulimit -n 4096
2222
script:

GitVersion.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
assembly-versioning-scheme: MajorMinorPatch
2+
mode: ContinuousDeployment
3+
4+
branches:
5+
6+
master:
7+
regex: master
8+
tag: master
9+
increment: Minor
10+
prevent-increment-of-merged-branch-version: true
11+
feature:
12+
regex: feature[/-]
13+
tag: a{BranchName}
14+
increment: Minor
15+
prevent-increment-of-merged-branch-version: false
16+
patch:
17+
regex: patch[/-]
18+
tag: useBranchName
19+
increment: Patch
20+
prevent-increment-of-merged-branch-version: false
21+
source-branches: ['release']
22+
release:
23+
regex: release[/-]
24+
tag: rc
25+
increment: None
26+
prevent-increment-of-merged-branch-version: false

GitVersionConfig.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

Winton.Extensions.Configuration.Consul.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1010
appveyor.yml = appveyor.yml
1111
build.sh = build.sh
1212
CONTRIBUTING.md = CONTRIBUTING.md
13-
GitVersionConfig.yaml = GitVersionConfig.yaml
13+
GitVersion.yml = GitVersion.yml
1414
LICENSE = LICENSE
1515
README.md = README.md
1616
stylecop.json = stylecop.json

appveyor.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ configuration:
88
- Release
99
skip_tags: true
1010
before_build:
11-
- dotnet restore
11+
- dotnet tool install -g GitVersion.Tool --version 4.0.1-beta1-58
12+
- dotnet gitversion /l console /output buildserver
1213
build_script:
13-
- msbuild /p:GetVersion=True /p:WriteVersionInfoToBuildLog=True
14+
- dotnet build -c Release -p:Version=%GitVersion_NuGetVersion%
1415
test_script:
15-
- dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --no-restore --configuration Release
16+
- dotnet test -c Release --no-build
1617
artifacts:
1718
- path: .\**\*.nupkg
1819
name: NuGet

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ set -e
44

55
# Build
66
dotnet restore
7-
dotnet build src/Winton.Extensions.Configuration.Consul --no-restore --configuration Release --framework netstandard2.0
8-
dotnet build test/Winton.Extensions.Configuration.Consul.Test --no-restore --configuration Release --framework netcoreapp2.2
9-
dotnet build test/Website --no-restore --configuration Release --framework netcoreapp2.2
7+
dotnet build src/Winton.Extensions.Configuration.Consul -c Release -f netstandard2.0 --no-restore
8+
dotnet build test/Winton.Extensions.Configuration.Consul.Test -c Release -f netcoreapp2.2 --no-restore
9+
dotnet build test/Website -c Release -f netcoreapp2.2 --no-restore
1010

1111
# Unit Test
12-
dotnet test test/Winton.Extensions.Configuration.Consul.Test/ --no-build --no-restore --configuration Release
12+
dotnet test -c Release --no-build
1313

1414
# Integration test
1515
if hash docker 2>/dev/null; then

src/Winton.Extensions.Configuration.Consul/Winton.Extensions.Configuration.Consul.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<Copyright>Copyright 2018 Winton</Copyright>
77
<Description>Provides support for configuring .NET Core applications with Consul</Description>
88
<GenerateDocumentationFile>True</GenerateDocumentationFile>
9-
<GetVersion>False</GetVersion>
109
<NoWarn>$(NoWarn);SA1101;SA1309;SA1413;</NoWarn>
1110
<PackageId>Winton.Extensions.Configuration.Consul</PackageId>
1211
<PackageIconUrl>https://raw.githubusercontent.com/wintoncode/Winton.Extensions.Configuration.Consul/master/icon.jpg</PackageIconUrl>
@@ -19,7 +18,6 @@
1918
<RepositoryUrl>https://github.com/wintoncode/Winton.Extensions.Configuration.Consul</RepositoryUrl>
2019
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
2120
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
22-
<WriteVersionInfoToBuildLog>False</WriteVersionInfoToBuildLog>
2321
</PropertyGroup>
2422

2523
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
@@ -32,7 +30,6 @@
3230

3331
<ItemGroup>
3432
<PackageReference Include="Consul" Version="0.7.2.6" />
35-
<PackageReference Include="GitVersionTask" Version="4.0.0-beta0012" PrivateAssets="All" />
3633
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.2" />
3734
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2" PrivateAssets="All" />
3835
</ItemGroup>

0 commit comments

Comments
 (0)