Skip to content

Commit e16f21f

Browse files
committed
Add build script and appveyor config
1 parent 88eaa41 commit e16f21f

File tree

6 files changed

+658
-1
lines changed

6 files changed

+658
-1
lines changed

Our.Umbraco.GraphQL.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Global
2020
{C2001952-0774-4BFA-AF30-043B3B16D275}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2121
{C2001952-0774-4BFA-AF30-043B3B16D275}.Debug|Any CPU.Build.0 = Debug|Any CPU
2222
{C2001952-0774-4BFA-AF30-043B3B16D275}.Release|Any CPU.ActiveCfg = Release|Any CPU
23-
{C2001952-0774-4BFA-AF30-043B3B16D275}.Release|Any CPU.Build.0 = Release|Any CPU
2423
{59294783-3A17-479B-90C5-A3A2967176DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2524
{59294783-3A17-479B-90C5-A3A2967176DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
2625
{59294783-3A17-479B-90C5-A3A2967176DE}.Release|Any CPU.ActiveCfg = Release|Any CPU

appveyor.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '{build}'
2+
os: Visual Studio 2017
3+
init:
4+
- git config --global core.autocrlf input
5+
- git config --global core.longpaths true
6+
shallow_clone: true
7+
build_script:
8+
build.cmd package
9+
test: off
10+
artifacts:
11+
- path: artifacts\*.nupkg
12+
name: NuGetPackages
13+
deploy: off

build.cmd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@ECHO OFF
2+
SETLOCAL EnableDelayedExpansion
3+
CLS
4+
5+
SET "buildVersion="
6+
IF DEFINED APPVEYOR_BUILD_NUMBER (
7+
SET buildVersion=%APPVEYOR_BUILD_NUMBER%
8+
SET buildVersion=00000!buildVersion!
9+
SET buildVersion=!buildVersion:~-6!
10+
SET buildVersion=build!buildVersion!
11+
) ELSE (
12+
SET /p versionSuffix="Please enter a version suffix (e.g. alpha001):"
13+
SET buildVersion=!versionSuffix!
14+
)
15+
16+
SET "target=%*"
17+
IF NOT DEFINED target (
18+
SET "target=default"
19+
)
20+
21+
dotnet tool install fake-cli --tool-path tools\bin\ --version 5.*
22+
tools\bin\fake.exe run tools\build.fsx --parallel 3 --target %target% -e buildVersion=!buildVersion!

tools/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.fake/
2+
.nuget/

tools/build.fsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// include Fake lib
2+
#r "paket:
3+
source nuget/dotnetcore
4+
source https://api.nuget.org/v3/index.json
5+
nuget FSharp.Core ~> 4.1
6+
nuget Fake.Core.Target
7+
nuget Fake.DotNet.Cli
8+
nuget Fake.IO.FileSystem //"
9+
#load "./.fake/build.fsx/intellisense.fsx"
10+
11+
open System
12+
open System.IO
13+
open Fake.Core
14+
open Fake.DotNet
15+
open Fake.IO
16+
17+
// Properties
18+
let currentDirectory = Directory.GetCurrentDirectory()
19+
let solutionFile = Directory.findFirstMatchingFile "*.sln" currentDirectory
20+
let artifactsDir = Path.getFullName "./artifacts/"
21+
22+
let buildVersion = if not BuildServer.isLocalBuild then Some BuildServer.buildVersion else None
23+
24+
// Targets
25+
Target.create "Clean" (fun _ ->
26+
Shell.cleanDirs [artifactsDir]
27+
)
28+
29+
Target.create "Build" (fun _ ->
30+
DotNet.build (fun c ->
31+
{ c with
32+
Configuration = DotNet.BuildConfiguration.Release
33+
OutputPath = Some artifactsDir
34+
}) solutionFile
35+
)
36+
37+
Target.create "Package" (fun _ ->
38+
DotNet.pack (fun c ->
39+
{ c with
40+
Configuration = DotNet.BuildConfiguration.Release
41+
OutputPath = Some artifactsDir
42+
VersionSuffix = buildVersion
43+
}) solutionFile
44+
)
45+
46+
Target.create "Default" ignore
47+
48+
open Fake.Core.TargetOperators
49+
50+
"Clean"
51+
==> "Build"
52+
==> "Default"
53+
54+
"Clean"
55+
==> "Package"
56+
57+
// start build
58+
Target.runOrDefault "Default"

0 commit comments

Comments
 (0)