Skip to content

Commit

Permalink
Use MinVer (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Dec 21, 2018
1 parent f443417 commit a38a90c
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project ToolsVersion="15.0">
<PropertyGroup>
<VersionPrefix>0.0.1</VersionPrefix>
<Authors>@jet @bartelink @eiriktsarpalis and contributors</Authors>
<Company>Jet.com</Company>
<Description>Composable high performance event sourcing componentry</Description>
Expand All @@ -21,7 +20,8 @@
<EnableSourceLink Condition=" '$(OS)' != 'Windows_NT' AND '$(MSBuildRuntimeType)' != 'Core' ">false</EnableSourceLink>

<!-- suppress false positive warning FS2003 about invalid version of AssemblyInformationalVersionAttribute -->
<NoWarn>FS2003</NoWarn>
<!-- Supress NU5105 triggered by trailing dotted elements such as .43 and .2 in e.g.: pr.43-rc1.2: The package version '<X>' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients. Change the package version to a SemVer 1.0.0 string. If the version contains a release label it must start with a letter. This message can be ignored if the package is not intended for older clients. -->
<NoWarn>$(NoWarn);FS2003;NU5105</NoWarn>
</PropertyGroup>

<!-- Workaround for https://github.com/xunit/xunit/issues/1357 -->
Expand Down
14 changes: 14 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
<Target Name="ComputePackageVersion" AfterTargets="MinVer" Condition=" '$(BUILD_PR)' != '' AND '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">
<PropertyGroup>
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(BUILD_PR)</PackageVersion>
<PackageVersion Condition="'$(MinVerPreRelease)' != ''">$(PackageVersion).$(MinVerPreRelease)</PackageVersion>
<PackageVersion Condition="'$(MinVerBuildMetadata)' != ''">$(PackageVersion)+$(MinVerBuildMetadata)</PackageVersion>
<Version>$(PackageVersion)</Version>
</PropertyGroup>
</Target>
<Target Name="ComputeFileVersion" AfterTargets="MinVer">
<PropertyGroup>
<BUILD_ID Condition="'$(BUILD_ID)' == ''">0</BUILD_ID>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_ID)</FileVersion>
</PropertyGroup>
</Target>
</Project>
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ The Equinox components within this repository are delivered as a series of multi
- `samples/TodoBackend` (in this repo): Standard https://todobackend.com compliant backend
- `Equinox.Tool` (Nuget: `dotnet tool install Equinox.Tool -g`): Tool incorporating a benchmark scenario runner, facilitating running representative load tests composed of transactions in `samples/Store` and `samples/TodoBackend` against any nominated store; this allows perf tuning and measurement in terms of both latency and transaction charge aspects.

## Versioning

## About Versioning

The repo is versioned based on [SemVer 2.0](https://semver.org/spec/v2.0.0.html) using the tiny-but-mighty [MinVer](https://github.com/adamralph/minver) from @adamralph. [See here](https://github.com/adamralph/minver#how-it-works) for more information on how it works.

## CONTRIBUTING

Please raise GitHub issues for any questions so others can benefit from the discussion.
Expand Down
26 changes: 12 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ jobs:
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: |
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)";
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_","");
$versionSuffixBRANCH = "$branchName-$buildId";
$isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/');
$isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne ""
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
displayName: compute VersionSuffix
- script: dotnet test build.proj -v n
displayName: dotnet test build.proj
env:
Expand All @@ -27,7 +17,8 @@ jobs:
- script: dotnet pack build.proj
displayName: dotnet pack build.proj
env:
VersionSuffix: '$(VersionSuffix)'
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'bin/nupkg'
Expand All @@ -39,7 +30,8 @@ jobs:
publishFeedCredentials: 'Jet-MyGet'
versioningScheme: byEnvVar
versionEnvVar: Version
packagesToPush: 'bin/nupkg/*.nupkg'
packagesToPush: _none
# packagesToPush: 'bin/nupkg/*.nupkg'

- job: Linux
pool:
Expand All @@ -58,7 +50,10 @@ jobs:
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: dotnet pack build.proj
displayName: dotnet pack build.proj
displayName: dotnet pack
env:
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)

- job: MacOS
pool:
Expand All @@ -77,4 +72,7 @@ jobs:
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: dotnet pack build.proj
displayName: dotnet pack build.proj
displayName: dotnet pack
env:
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)
8 changes: 4 additions & 4 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<Cfg>--configuration Release</Cfg>

<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute>
<PackOptions>-o $(ThisDirAbsolute)bin/nupkg --version-suffix "$(VersionSuffix)"</PackOptions>

<PrOption Condition =" '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">/p:BUILD_PR=$(BUILD_PR) </PrOption>
<PackOptions>/p:BUILD_ID=$(BUILD_ID) $(PrOption) -o $(ThisDirAbsolute)bin/nupkg</PackOptions>

<TestOptions>--logger:trx</TestOptions>
<!-- disable known test failures on mono -->
<TestOptions Condition=" '$(OS)' != 'Windows_NT' " >$(TestOptions) --filter KnownFailOn!=Mono</TestOptions>
Expand All @@ -18,9 +19,8 @@
<Exec Command="dotnet pack src/Equinox.Codec $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox.EventStore $(Cfg) $(PackOptions)" />
<Exec Command="dotnet pack src/Equinox.MemoryStore $(Cfg) $(PackOptions)" />
<!-- TODO reinstate - this is just to make the build pass while MyGet chokes on it
<Exec Command='dotnet publish tools/Equinox.Tool $(Cfg) -f net461 -o "$(RepoDir)/bin/equinox-tool/net461" ' />
<Exec Command="dotnet pack tools/Equinox.Tool $(Cfg) $(PackOptions) /p:PackAsTool=true" /> -->
<Exec Command="dotnet pack tools/Equinox.Tool $(Cfg) $(PackOptions) /p:PackAsTool=true" />
</Target>

<!-- tests hangs on osx -->
Expand Down
2 changes: 2 additions & 0 deletions src/Equinox.Codec/Equinox.Codec.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' == 'net461' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
Expand Down
2 changes: 2 additions & 0 deletions src/Equinox.EventStore/Equinox.EventStore.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' != 'netstandard2.0' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="EventStore.ClientAPI.NetCore" Version="4.1.1-rc" Condition=" '$(TargetFramework)' == 'netstandard2.0'" />
Expand Down
2 changes: 2 additions & 0 deletions src/Equinox.MemoryStore/Equinox.MemoryStore.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' == 'net461' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Equinox/Equinox.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' == 'net461' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="Serilog" Version="2.7.1" />
Expand Down
2 changes: 2 additions & 0 deletions tools/Equinox.Tool/Equinox.Tool.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="1.0.0-beta.2" />

<PackageReference Include="Argu" Version="5.1.0" />
<!--Handle TypeShape-restriction; would otherwise use 3.1.2.5-->
<PackageReference Include="FSharp.Core" Version="4.0.0.1" Condition=" '$(TargetFramework)' == 'net461' " />
Expand Down

0 comments on commit a38a90c

Please sign in to comment.