Skip to content

Commit

Permalink
Merge pull request #7 from panesofglass/build
Browse files Browse the repository at this point in the history
Update build to support tags
  • Loading branch information
panesofglass authored Oct 9, 2018
2 parents d82d4cd + 5f0cf19 commit 7d1d790
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 41 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
14 changes: 8 additions & 6 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,19 +15,19 @@ 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 pack -c Release --include-symbols
- dotnet pack --no-build -c Release --include-symbols

branches:
except:
- gh-pages
- gh-pages
16 changes: 6 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
version: 5.0.1-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 pack -c Release --include-symbols --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}"

test: off

- ps: |
.\build.ps1
if ($lastexitcode -ne 0){ exit $lastexitcode }
artifacts:
- path: '**\*.nupkg'
- path: bin\*.nupkg

20 changes: 20 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[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 Hephaestus.sln /p:Version=$version$versionSuffix
dotnet pack --no-build -c Release src/Hephaestus /p:Version=$version$versionSuffix -o $psscriptroot/bin
31 changes: 30 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>5.0.1</VersionPrefix>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DefineConstants Condition="'$(Hopac)' == 'true'">$(DefineConstants);HOPAC</DefineConstants>

<VersionPrefix>5.1.0</VersionPrefix>
<Authors>Andrew Cherry</Authors>
<Description>Graph-base protocol machines for F#</Description>
<Description Condition="'$(Hopac)' == 'true'">$(Description) powered by the Hopac concurrency library</Description>
Expand All @@ -12,5 +16,30 @@
<RepositoryUrl>https://github.com/xyncro/hephaestus</RepositoryUrl>
<PackageTags>$(PackageTags);protocol;machine;functional;graphs;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>
<Compile Include="$(MSBuildThisFileDirectory)Hephaestus\Hephaestus.fs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="4.3.4" />
<PackageReference Include="Aether" Version="[8.2.0,9)" />
<PackageReference Include="Anat" Version="[1.0.1,2)" />
<PackageReference Include="Hekate" Version="[3.2.1,4)" />
</ItemGroup>

<ItemGroup Condition="'$(Hopac)' == 'true'">
<PackageReference Include="Hopac" Version="0.3.23" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
</ItemGroup>
</Project>
22 changes: 0 additions & 22 deletions src/Hephaestus.Common.targets

This file was deleted.

1 change: 0 additions & 1 deletion src/Hephaestus.Hopac/Hephaestus.Hopac.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
<PropertyGroup>
<Hopac>true</Hopac>
</PropertyGroup>
<Import Project="..\Hephaestus.Common.targets" />
</Project>
1 change: 0 additions & 1 deletion src/Hephaestus/Hephaestus.fsproj
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Hephaestus.Common.targets" />
</Project>

0 comments on commit 7d1d790

Please sign in to comment.