Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from panesofglass/build
Browse files Browse the repository at this point in the history
Update build
  • Loading branch information
panesofglass authored Oct 10, 2018
2 parents 90e6c31 + ee70ad4 commit 8b8e76f
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ $tf/
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
.idea/

# JustCode is a .NET coding addin-in
.JustCode
Expand Down
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: csharp

mono: 5.2.0
dotnet: 2.0.0
dotnet: 2.1.402

mono:
- 5.2.0

install:
- mozroots --import --sync
Expand All @@ -13,21 +15,21 @@ matrix:
- os: linux # Ubuntu 14.04
dist: trusty
sudo: required
dotnet: 2.0.0
dotnet: 2.1.402
- os: osx # OSX 10.12
osx_image: xcode9.1
dotnet: 2.0.0
dotnet: 2.1.402
dist: trusty
sudo: required

script:
- dotnet --info
- dotnet restore
- dotnet build -c Release
- dotnet test tests/Freya.Core.Tests/Freya.Core.Tests.fsproj -c Release
- dotnet test tests/Freya.Core.Hopac.Tests/Freya.Core.Hopac.Tests.fsproj -c Release
- dotnet pack -c Release --include-symbols
- dotnet tests/Freya.Core.Benchmarks/bin/Release/netcoreapp2.0/Freya.Core.Benchmarks.dll
- dotnet test --no-build tests/Freya.Core.Tests/Freya.Core.Tests.fsproj -c Release
- dotnet test --no-build tests/Freya.Core.Hopac.Tests/Freya.Core.Hopac.Tests.fsproj -c Release
- dotnet pack --no-build -c Release --include-symbols
- dotnet tests/Freya.Core.Benchmarks/bin/Release/netcoreapp2.1/Freya.Core.Benchmarks.dll

branches:
except:
Expand Down
20 changes: 6 additions & 14 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
version: 4.0.0-aci-{build}

image: Visual Studio 2017
build_script:
- ps: dotnet --info
- ps: dotnet restore
- ps: dotnet build -c Release --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}"
- ps: dotnet test -c Release tests\Freya.Core.Tests\Freya.Core.Tests.fsproj
- ps: dotnet test -c Release tests\Freya.Core.Hopac.Tests\Freya.Core.Hopac.Tests.fsproj
- ps: dotnet pack -c Release --include-symbols --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}"
- ps: dotnet .\tests\Freya.Core.Benchmarks\bin\Release\netcoreapp2.0\Freya.Core.Benchmarks.dll

test: off

- ps: |
.\build.ps1
if ($lastexitcode -ne 0){ exit $lastexitcode }
artifacts:
- path: '**\*.nupkg'
- path: '**\BenchmarkDotNet.Artifacts\**\*.*'
- path: bin\*.nupkg
- path: '**\BenchmarkDotNet.Artifacts\**\*.*'
24 changes: 24 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[xml]$doc = Get-Content .\src\Directory.Build.props
$version = $doc.Project.PropertyGroup.VersionPrefix # the version under development, update after a release
$versionSuffix = '-build.0' # manually incremented for local builds

function isVersionTag($tag){
$v = New-Object Version
[Version]::TryParse($tag, [ref]$v)
}

if ($env:appveyor){
$versionSuffix = '-build.' + $env:appveyor_build_number
if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
$version = $env:appveyor_repo_tag_name
$versionSuffix = ''
}
Update-AppveyorBuild -Version "$version$versionSuffix"
}

dotnet build -c Release Freya.Core.sln /p:Version=$version$versionSuffix
dotnet test --no-build -c Release tests/Freya.Core.Tests/Freya.Core.Tests.fsproj
dotnet test --no-build -c Release tests/Freya.Core.Hopac.Tests/Freya.Core.Hopac.Tests.fsproj
dotnet pack --no-build -c Release src/Freya.Core /p:Version=$version$versionSuffix -o $psscriptroot/bin
dotnet pack --no-build -c Release src/Freya.Core.Hopac /p:Version=$version$versionSuffix -o $psscriptroot/bin
dotnet tests/Freya.Core.Benchmarks/bin/Release/netcoreapp2.1/Freya.Core.Benchmarks.dll
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
<RepositoryUrl>https://github.com/xyncro/freya-core</RepositoryUrl>
<PackageTags>$(PackageTags);functional;web;freya;f#;fsharp</PackageTags>
<PackageTags Condition="'$(Hopac)' == 'true'">$(PackageTags);hopac</PackageTags>

<!-- SourceLink related properties https://github.com/dotnet/SourceLink#using-sourcelink -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Freya.Core.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.3.4" />
<PackageReference Include="Aether" Version="[8.2.0,9)" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/Freya.Core.Benchmarks/Freya.Core.Benchmarks.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
<DebugType>none</DebugType>
<ServerGarbageCollection>true</ServerGarbageCollection>
Expand Down
5 changes: 3 additions & 2 deletions tests/Freya.Core.Tests.Common.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<DefineConstants Condition="'$(Hopac)' == 'true'">$(DefineConstants);HOPAC</DefineConstants>
<ServerGarbageCollection Condition="'$(Hopac)' == 'true'">true</ServerGarbageCollection>
<IsPackable>false</IsPackable>
Expand Down

0 comments on commit 8b8e76f

Please sign in to comment.