Skip to content

Commit b738bf5

Browse files
author
Marc Woolfson
committed
Updated build script as per destructurama/attributed project
1 parent cee3bcb commit b738bf5

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

Build.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ if(Test-Path .\artifacts) {
1212
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
1313
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
1414
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"]
15+
$commitHash = $(git rev-parse --short HEAD)
16+
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""]
1517

16-
echo "build: Version suffix is $suffix"
18+
echo "build: Package version suffix is $suffix"
19+
echo "build: Build version suffix is $buildSuffix"
1720

1821
foreach ($src in ls src/*) {
1922
Push-Location $src
2023

2124
echo "build: Packaging project in $src"
2225

23-
& dotnet pack -c Release -o ..\..\artifacts --version-suffix=$suffix --include-source
26+
& dotnet build -c Release --version-suffix=$buildSuffix
27+
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build
2428
if($LASTEXITCODE -ne 0) { exit 1 }
2529

2630
Pop-Location

appveyor.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '{build}'
2+
skip_tags: true
3+
image: Visual Studio 2017
4+
configuration: Release
5+
test: off
6+
build_script:
7+
- ps: ./Build.ps1
8+
artifacts:
9+
- path: artifacts/Destructurama.*.nupkg
10+
deploy:
11+
- provider: NuGet
12+
api_key:
13+
secure: Db273rounfdesOqPXjqPrP6jeHGKkI52Rk+FSdnh6X/S6MuCelVFMpVMn67CcZgv
14+
skip_symbols: true
15+
on:
16+
branch: /^(master|dev)$/

0 commit comments

Comments
 (0)