Skip to content

Commit

Permalink
Merge pull request #2011 from fsharp/release/next
Browse files Browse the repository at this point in the history
Release 5.2
  • Loading branch information
matthid authored Jul 11, 2018
2 parents 320bdd6 + 01dd24e commit 3faee4d
Show file tree
Hide file tree
Showing 63 changed files with 1,992 additions and 961 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ env:
- HOME=/home/travis APPDATA=/home/travis LocalAppData=/home/travis


before install:
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install openssl ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --force openssl ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gnu-tar ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt update; sudo apt install ruby ruby-dev rubygems-integration build-essential -y ; fi
- gem install --no-ri --no-rdoc fpm

mono:
- 5.0.1
Expand Down
12 changes: 12 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release Notes

## 5.2.0 - 2018-07-10

* ENHANCEMENT: Improve output around empty target descriptions - https://github.com/fsharp/FAKE/pull/1996
* BUGFIX: Proper handling of dotnet SDK versioning - https://github.com/fsharp/FAKE/pull/1963
* NEW: Add debian package (maintainer wanted for hosting!) - https://github.com/fsharp/FAKE/pull/1863
* BUGFIX: Fix ambiguity in new octokit release - https://github.com/fsharp/FAKE/pull/2004
* BUGFIX: Fix XML poke - https://github.com/fsharp/FAKE/pull/2005
* BUGFIX: Fix SQLPackage path with VS2017 - https://github.com/fsharp/FAKE/pull/2006
* BUGFIX: Warn when resolved FSharp.Core doesn't match - https://github.com/fsharp/FAKE/issues/2001
* ENHANCEMENT: Upgrade runner to FSharp.Core 4.5
* ENHANCEMENT: Fix tracing of final and failure targets and add new `Trace.useWith` API - https://github.com/fsharp/FAKE/pull/2009 and https://github.com/fsharp/FAKE/pull/2016

## 5.1.0 - 2018-06-18

* NEW: module Fake.DotNet.Fsi to start fsharpi/fsi.exe on a F# script - https://github.com/fsharp/FAKE/pull/1970
Expand Down
178 changes: 79 additions & 99 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if BOOTSTRAP

#r "paket:
source nuget/dotnetcore
source release/dotnetcore
source https://api.nuget.org/v3/index.json
nuget FSharp.Core ~> 4.1
nuget System.AppContext prerelease
Expand Down Expand Up @@ -87,8 +87,12 @@ let buildDir = "./build"
let testDir = "./test"
let docsDir = "./docs"
let apidocsDir = "./docs/apidocs/"
let nugetDncDir = "./nuget/dotnetcore"
let nugetLegacyDir = "./nuget/legacy"

let releaseDir = "./release"
let nugetDncDir = releaseDir </> "dotnetcore"
let chocoReleaseDir = nugetDncDir </> "chocolatey"
let nugetLegacyDir = releaseDir </> "legacy"

let reportDir = "./report"
let packagesDir = "./packages"
let buildMergedDir = buildDir </> "merged"
Expand Down Expand Up @@ -722,8 +726,8 @@ Target.create "BootstrapTestDotNetCore" (fun _ ->
let executeTarget target =
if clearCache then clear ()
let fileName =
if Environment.isUnix then "nuget/dotnetcore/Fake.netcore/current/fake"
else "nuget/dotnetcore/Fake.netcore/current/fake.exe"
if Environment.isUnix then nugetDncDir </> "Fake.netcore/current/fake"
else nugetDncDir </> "Fake.netcore/current/fake.exe"
Process.execSimple (fun info ->
{ info with
FileName = fileName
Expand Down Expand Up @@ -907,14 +911,14 @@ Target.create "CreateNuGet" (fun _ ->
!! (nugetToolsDir @@ "FAKE.exe") |> set64BitCorFlags
NuGet.NuGet.NuGet (setParams >> x64ify) "fake.nuspec"

let legacyZip = "nuget/fake-legacy-packages.zip"
let legacyZip = releaseDir </> "fake-legacy-packages.zip"
!! (nugetLegacyDir </> "**/*.nupkg")
|> Zip.zip nugetLegacyDir legacyZip
publish legacyZip
)

let runtimes =
[ "win7-x86"; "win7-x64"; "osx.10.11-x64"; "ubuntu.14.04-x64"; "ubuntu.16.04-x64" ]
[ "win7-x86"; "win7-x64"; "osx.10.11-x64"; "linux-x64" ]

module CircleCi =
let isCircleCi = Environment.environVarAsBool "CIRCLECI"
Expand Down Expand Up @@ -984,6 +988,7 @@ Target.create "_DotNetPackage" (fun _ ->
Environment.setEnvironVar "Authors" (String.separated ";" authors)
Environment.setEnvironVar "Description" projectDescription
Environment.setEnvironVar "PackageReleaseNotes" (release.Notes |> String.toLines)
Environment.setEnvironVar "SourceLinkCreate" "false"
Environment.setEnvironVar "PackageTags" "build;fake;f#"
Environment.setEnvironVar "PackageIconUrl" "https://raw.githubusercontent.com/fsharp/FAKE/fee4f05a2ee3c646979bf753f3b1f02d927bfde9/help/content/pics/logo.png"
Environment.setEnvironVar "PackageProjectUrl" "https://github.com/fsharp/Fake"
Expand Down Expand Up @@ -1013,19 +1018,19 @@ Target.create "DotNetCoreCreateZipPackages" (fun _ ->
Environment.setEnvironVar "Version" nugetVersion

// build zip packages
!! "nuget/dotnetcore/*.nupkg"
-- "nuget/dotnetcore/*.symbols.nupkg"
|> Zip.zip "nuget/dotnetcore" "nuget/dotnetcore/Fake.netcore/fake-dotnetcore-packages.zip"
!! (nugetDncDir </> "*.nupkg")
-- (nugetDncDir </> "*.symbols.nupkg")
|> Zip.zip nugetDncDir (nugetDncDir </> "Fake.netcore/fake-dotnetcore-packages.zip")

("portable" :: runtimes)
|> Seq.iter (fun runtime ->
let runtimeDir = sprintf "nuget/dotnetcore/Fake.netcore/%s" runtime
let runtimeDir = sprintf "%s/Fake.netcore/%s" nugetDncDir runtime
!! (sprintf "%s/**" runtimeDir)
|> Zip.zip runtimeDir (sprintf "nuget/dotnetcore/Fake.netcore/fake-dotnetcore-%s.zip" runtime)
|> Zip.zip runtimeDir (sprintf "%s/Fake.netcore/fake-dotnetcore-%s.zip" nugetDncDir runtime)
)

runtimes @ [ "portable"; "packages" ]
|> List.map (fun n -> sprintf "nuget/dotnetcore/Fake.netcore/fake-dotnetcore-%s.zip" n)
|> List.map (fun n -> sprintf "%s/Fake.netcore/fake-dotnetcore-%s.zip" nugetDncDir n)
|> List.iter publish
)

Expand All @@ -1047,31 +1052,31 @@ Target.create "DotNetCoreCreateChocolateyPackage" (fun _ ->
if Environment.isWindows
then p
else { p with ToolPath = altToolPath }
Directory.ensure "nuget/dotnetcore/chocolatey"
Directory.ensure chocoReleaseDir
Choco.packFromTemplate (fun p ->
{ p with
PackageId = "fake"
ReleaseNotes = release.Notes |> String.toLines
InstallerType = Choco.ChocolateyInstallerType.SelfContained
Version = chocoVersion
Files =
[ (System.IO.Path.GetFullPath @"nuget\dotnetcore\Fake.netcore\win7-x86") + @"\**", Some "bin", None
[ (System.IO.Path.GetFullPath (nugetDncDir </> @"Fake.netcore\win7-x86")) + @"\**", Some "bin", None
(System.IO.Path.GetFullPath @"src\VERIFICATION.txt"), Some "VERIFICATION.txt", None
(System.IO.Path.GetFullPath @"License.txt"), Some "LICENSE.txt", None ]
OutputDir = "nuget/dotnetcore/chocolatey" }
OutputDir = chocoReleaseDir }
|> changeToolPath) "src/Fake-choco-template.nuspec"

let name = sprintf "%s.%s" "fake" chocoVersion
let chocoPackage = sprintf "nuget/dotnetcore/chocolatey/%s.nupkg" name
let chocoTargetPackage = sprintf "nuget/dotnetcore/chocolatey/chocolatey-%s.nupkg" name
let chocoPackage = sprintf "%s/%s.nupkg" chocoReleaseDir name
let chocoTargetPackage = sprintf "%s/chocolatey-%s.nupkg" chocoReleaseDir name
File.Copy(chocoPackage, chocoTargetPackage, true)
publish chocoTargetPackage
)
Target.create "DotNetCorePushChocolateyPackage" (fun _ ->
let name = sprintf "%s.%s.nupkg" "fake" chocoVersion
let path = sprintf "nuget/dotnetcore/chocolatey/%s" name
let path = sprintf "%s/%s" chocoReleaseDir name
if not Environment.isWindows && not (File.exists path) && fromArtifacts then
Directory.ensure "nuget/dotnetcore/chocolatey"
Directory.ensure chocoReleaseDir
Shell.copyFile path (artifactsDir </> sprintf "chocolatey-%s" name)

let altToolPath = getChocoWrapper()
Expand All @@ -1089,77 +1094,39 @@ Target.create "CheckReleaseSecrets" (fun _ ->
secret.Force() |> ignore
)

let executeFPM args =
printfn "%s %s" "fpm" args
Shell.Exec("fpm", args=args, dir="bin")


type SourceType =
| Dir of source:string * target:string
type DebPackageManifest =
{
SourceType : SourceType
Name : string
Version : string
Dependencies : (string * string option) list
BeforeInstall : string option
AfterInstall : string option
ConfigFile : string option
AdditionalOptions: string list
AdditionalArgs : string list
}
(*
See https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
Ask @theangrybyrd (slack)
{
SourceType = Dir("./MyCoolApp", "/opt/")
Name = "mycoolapp"
Version = originalVersion
Dependencies = [("mono-devel", None)]
BeforeInstall = "../deploy/preinst" |> Some
AfterInstall = "../deploy/postinst" |> Some
ConfigFile = "/etc/mycoolapp/default.conf" |> Some
AdditionalOptions = []
AdditionalArgs =
[ "../deplo/mycoolapp.service=/lib/systemd/system/" ]
}
23:08
so thats stuff i you want to setup like users or what not
23:09
adding to your path would be in the after script postinst
23:10
setting permissions also, its just a shell script
23:10
might also want a prerm and postrm if you want to play nice on cleanup
*)

Target.create "DotNetCoreCreateDebianPackage" (fun _ ->
let createDebianPackage (manifest : DebPackageManifest) =
let argsList = ResizeArray<string>()
argsList.Add <| match manifest.SourceType with
| Dir (_) -> "-s dir"
argsList.Add <| "-t deb"
argsList.Add <| "-f"
argsList.Add <| (sprintf "-n %s" manifest.Name)
argsList.Add <| (sprintf "-v %s" (manifest.Version.Replace("-","~")))
let dependency name version =
match version with
| Some v -> sprintf "-d '%s %s'" name v
| None -> sprintf "-d '%s'" name
argsList.AddRange <| (Seq.map(fun (a,b) -> dependency a b) manifest.Dependencies)
manifest.BeforeInstall |> Option.iter(sprintf "--before-install %s" >> argsList.Add)
manifest.AfterInstall |> Option.iter(sprintf "--after-install %s" >> argsList.Add)
manifest.ConfigFile |> Option.iter(sprintf "--config-files %s" >> argsList.Add)
argsList.AddRange <| manifest.AdditionalOptions
argsList.Add <| match manifest.SourceType with
| Dir (source,target) -> sprintf "%s=%s" source target
argsList.AddRange <| manifest.AdditionalArgs
if argsList |> String.concat " " |> executeFPM <> 0 then
failwith "Failed creating deb package"
ignore createDebianPackage
()

DotNet.restore (fun opt ->
{ opt with
Common = { opt.Common with WorkingDirectory = "src/app/fake-cli/" } |> dtntSmpl
Runtime = Some "linux-x64"}) "fake-cli.fsproj"

let runtime = "linux-x64"
let targetFramework = "netcoreapp2.1"
let args =
[
sprintf "/t:%s" "CreateDeb"
sprintf "/p:TargetFramework=%s" targetFramework
sprintf "/p:CustomTarget=%s" "CreateDeb"
sprintf "/p:RuntimeIdentifier=%s" runtime
sprintf "/p:Configuration=%s" "Release"
sprintf "/p:PackageVersion=%s" simpleVersion
] |> String.concat " "
let result =
DotNet.exec (fun opt ->
{ opt with
WorkingDirectory = "src/app/fake-cli/" } |> dtntSmpl
) "msbuild" args
if result.OK |> not then
failwith "Debian package creation failed"


let fileName = sprintf "fake-cli.%s.%s.deb" simpleVersion runtime
let sourceFile = sprintf "src/app/fake-cli/bin/Release/%s/%s/%s" targetFramework runtime fileName
Directory.ensure nugetDncDir
let target = sprintf "%s/%s" nugetDncDir fileName
File.Copy(sourceFile, target, true)
publish target
)


Expand Down Expand Up @@ -1199,8 +1166,8 @@ Target.create "DotNetCorePushNuGet" (fun _ ->
++ (templateDir </> "*/*.fsproj")
|> Seq.iter(fun proj ->
let projName = Path.GetFileName(Path.GetDirectoryName proj)
!! (sprintf "nuget/dotnetcore/%s.*.nupkg" projName)
-- (sprintf "nuget/dotnetcore/%s.*.symbols.nupkg" projName)
!! (sprintf "%s/%s.*.nupkg" nugetDncDir projName)
-- (sprintf "%s/%s.*.symbols.nupkg" nugetDncDir projName)
|> Seq.iter (nugetPush 4))
)

Expand Down Expand Up @@ -1255,9 +1222,14 @@ Target.create "FastRelease" (fun _ ->
Git.Branches.tag gitDirectory simpleVersion
Git.Branches.pushTag gitDirectory url simpleVersion

let linuxRuntime = "linux-x64"
let debFileName = sprintf "fake-cli.%s.%s.deb" simpleVersion linuxRuntime
let debTarget = sprintf "%s/%s" nugetDncDir debFileName

let files =
runtimes @ [ "portable"; "packages" ]
|> List.map (fun n -> sprintf "nuget/dotnetcore/Fake.netcore/fake-dotnetcore-%s.zip" n)
|> List.map (fun n -> sprintf "%s/Fake.netcore/fake-dotnetcore-%s.zip" nugetDncDir n)
|> fun l -> l @ [ debTarget ]

GitHub.createClientWithToken token
|> GitHub.draftNewRelease github_release_user gitName simpleVersion (release.SemVer.PreRelease <> None) release.Notes
Expand Down Expand Up @@ -1296,27 +1268,33 @@ Target.create "PrepareArtifacts" (fun _ ->
|> Seq.toList
Trace.tracefn "files: %A" files
files
|> Shell.copy "nuget/dotnetcore/Fake.netcore"
|> Shell.copy (nugetDncDir </> "Fake.netcore")

unzip "nuget/dotnetcore" (artifactsDir </> "fake-dotnetcore-packages.zip")
unzip nugetDncDir (artifactsDir </> "fake-dotnetcore-packages.zip")

if Environment.isWindows then
Directory.ensure "nuget/dotnetcore/chocolatey"
Directory.ensure chocoReleaseDir
let name = sprintf "%s.%s.nupkg" "fake" chocoVersion
Shell.copyFile (sprintf "nuget/dotnetcore/chocolatey/%s" name) (artifactsDir </> sprintf "chocolatey-%s" name)
Shell.copyFile (sprintf "%s/%s" chocoReleaseDir name) (artifactsDir </> sprintf "chocolatey-%s" name)
else
unzip "." (artifactsDir </> "chocolatey-requirements.zip")

Directory.ensure "nuget/legacy"
unzip "nuget/legacy" (artifactsDir </> "fake-legacy-packages.zip")
Directory.ensure nugetLegacyDir
unzip nugetLegacyDir (artifactsDir </> "fake-legacy-packages.zip")

Directory.ensure "temp/build"
!! ("nuget" </> "legacy" </> "*.nupkg")
!! (nugetLegacyDir </> "*.nupkg")
|> Seq.iter (fun pack ->
unzip "temp/build" pack
)
Shell.copyDir "build" "temp/build" (fun _ -> true)

let linuxRuntime = "linux-x64"
let debFileName = sprintf "fake-cli.%s.%s.deb" simpleVersion linuxRuntime
Directory.ensure nugetDncDir
let debTarget = sprintf "%s/%s" nugetDncDir debFileName
Shell.copyFile debTarget (artifactsDir </> debFileName)

let unzipIfExists dir file =
Directory.ensure dir
if File.Exists file then
Expand Down Expand Up @@ -1487,6 +1465,8 @@ let prevDocs =
==> "CreateNuGet"
==> "CopyLicense"
=?> ("DotNetCoreCreateChocolateyPackage", Environment.isWindows)
==> "DotNetCoreCreateDebianPackage"
=?> ("GenerateDocs", BuildServer.isLocalBuild && Environment.isWindows)
==> "Default"
(if fromArtifacts then "PrepareArtifacts" else "_AfterBuild")
=?> ("GenerateDocs", not <| Environment.hasEnvironVar "SkipDocs")
Expand Down
6 changes: 1 addition & 5 deletions fake.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env bash

# Install .NET Core (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script)
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current

PATH="~/.dotnet:$PATH"
dotnet restore build.proj
dotnet fake $@
dotnet fake $@
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk" : {
"version": "2.1.300"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#r "paket:
storage: none
source https://nuget.org/api/v2
source ../../../nuget/dotnetcore
source ../../../release/dotnetcore
//source https://ci.appveyor.com/nuget/paket
nuget Fake.Core.Context prerelease"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
storage: none
source https://nuget.org/api/v2
source ..\..\../../../nuget/dotnetcore
source ..\..\../../../release/dotnetcore

nuget Fake.Core.Target prerelease
nuget FSharp.Core prerelease
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if FAKE_DEPENDENCIES
#r "paket:
source https://nuget.org/api/v2
source ../../../nuget/dotnetcore
source ../../../release/dotnetcore
nuget Fake.Core.Target prerelease
nuget System.Reactive.Compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#r "paket:
storage: none
source https://nuget.org/api/v2
source ../../../nuget/dotnetcore
source ../../../release/dotnetcore
//source https://ci.appveyor.com/nuget/paket
nuget Fake.Runtime prerelease
Expand Down
Loading

0 comments on commit 3faee4d

Please sign in to comment.