Skip to content

Commit f970d24

Browse files
authored
Merge pull request #51 from panesofglass/build
Update build to version and package based on tag
2 parents 9fccb47 + b4abb0c commit f970d24

5 files changed

Lines changed: 39 additions & 19 deletions

File tree

.travis.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
language: csharp
22

3-
mono: 5.2.0
4-
dotnet: 2.0.0
3+
dotnet: 2.1.402
4+
5+
mono:
6+
- 5.2.0
57

68
install:
79
- mozroots --import --sync
@@ -13,20 +15,20 @@ matrix:
1315
- os: linux # Ubuntu 14.04
1416
dist: trusty
1517
sudo: required
16-
dotnet: 2.0.0
18+
dotnet: 2.1.402
1719
- os: osx # OSX 10.12
1820
osx_image: xcode9.1
19-
dotnet: 2.0.0
21+
dotnet: 2.1.402
2022
dist: trusty
2123
sudo: required
2224

2325
script:
2426
- dotnet --info
2527
- dotnet restore
2628
- dotnet build -c Release
27-
- dotnet test -c Release tests/Aether.Tests/Aether.Tests.fsproj
28-
- dotnet pack -c Release --include-symbols
29+
- dotnet test --no-build -c Release tests/Aether.Tests/Aether.Tests.fsproj
30+
- dotnet pack --no-build -c Release --include-symbols
2931

3032
branches:
3133
except:
32-
- gh-pages
34+
- gh-pages

appveyor.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
version: 8.2.0-aci-{build}
2-
1+
image: Visual Studio 2017
32
build_script:
4-
- ps: dotnet --info
5-
- ps: dotnet restore
6-
- ps: dotnet build -c Release --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}"
7-
- ps: dotnet test -c Release tests/Aether.Tests/Aether.Tests.fsproj
8-
- ps: dotnet pack -c Release --include-symbols --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}"
9-
3+
- ps: |
4+
.\build.ps1
5+
if ($lastexitcode -ne 0){ exit $lastexitcode }
106
test: off
11-
127
artifacts:
13-
- path: '**\*.nupkg'
8+
- path: bin\*.nupkg

build.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[xml]$doc = Get-Content .\src\Directory.Build.props
2+
$version = $doc.Project.PropertyGroup.VersionPrefix # the version under development, update after a release
3+
$versionSuffix = '-build.0' # manually incremented for local builds
4+
5+
function isVersionTag($tag){
6+
$v = New-Object Version
7+
[Version]::TryParse($tag, [ref]$v)
8+
}
9+
10+
if ($env:appveyor){
11+
$versionSuffix = '-build.' + $env:appveyor_build_number
12+
if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){
13+
$version = $env:appveyor_repo_tag_name
14+
$versionSuffix = ''
15+
}
16+
Update-AppveyorBuild -Version "$version$versionSuffix"
17+
}
18+
19+
dotnet build -c Release Aether.sln /p:Version=$version$versionSuffix
20+
dotnet test --no-build -c Release tests/Aether.Tests/Aether.Tests.fsproj
21+
dotnet pack --no-build -c Release /p:Version=$version$versionSuffix -o $psscriptroot/bin

src/Aether/Aether.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
44
<GenerateDocumentationFile>true</GenerateDocumentationFile>
55
</PropertyGroup>
6-
76
<ItemGroup>
87
<Compile Include="Aether.fs" />
98
</ItemGroup>

src/Directory.Build.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<VersionPrefix>8.2.0</VersionPrefix>
4+
<VersionPrefix>8.3.0</VersionPrefix>
55
<Authors>Andrew Cherry, Marcus Griep, Max Malook</Authors>
66
<Description>Optics for F#</Description>
77
<Copyright>Copyright © Xyncro Ltd</Copyright>
@@ -11,5 +11,8 @@
1111
<RepositoryUrl>https://github.com/xyncro/aether</RepositoryUrl>
1212
<PackageTags>$(PackageTags);lens;prism;isomorphism;optic;f#;fsharp</PackageTags>
1313
</PropertyGroup>
14+
<ItemGroup>
15+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
16+
</ItemGroup>
1417
</Project>
1518

0 commit comments

Comments
 (0)