Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build and test

on:
push:
branches: [ dev ]
branches: [ giraffe-fork ]
pull_request:
branches: [ dev ]
branches: [ giraffe-fork ]


jobs:
Expand All @@ -25,7 +25,7 @@ jobs:
run: ./build.sh runtestsallnonetfx

build-and-test-windows:

runs-on: windows-latest

steps:
Expand All @@ -37,3 +37,20 @@ jobs:
- name: Build and test (includes netfx)
working-directory: ./
run: ./build.cmd runtestsall

publish-nuget:
needs: [build-and-test-linux, build-and-test-windows]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x.x
- name: Publish to GitHub Packages
run: |
./build.sh PreReleaseNoDocs --prerelease-suffix=giraffe --non-interactive
env:
NUGET_KEY: ${{ secrets.GITHUB_TOKEN }}
NUGET_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ temp/gh-pages
/plotly-net-gource.gif
/plotly-gource.x264.avi
/plotly-gource.ppm
.idea
3 changes: 1 addition & 2 deletions Plotly.NET.TestSuite.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpTestBase", "tests\Com
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "CoreTests", "tests\CoreTests\CoreTests\CoreTests.fsproj", "{BA47F7BE-B699-4E65-9CD0-938F92BA976C}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "StrongNameTests", "tests\CoreTests\StrongNameTests\StrongNameTests.fsproj", "{26AA07CD-168B-45FC-93D3-315A26198E92}"
EndProject

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpInteroperabilityTests", "tests\CoreTests\CSharpInteroperabilityTests\CSharpInteroperabilityTests.csproj", "{FEAB6AB7-1F9A-4E75-B047-F34C3AE1919B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpTests", "tests\ExtensionLibsTests\CSharpTests\CSharpTests.csproj", "{24AE6CF2-8A86-4F8B-82D6-30D04D674933}"
Expand Down
9 changes: 0 additions & 9 deletions Plotly.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "CoreTests", "tests\CoreTest
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpInteroperabilityTests", "tests\CoreTests\CSharpInteroperabilityTests\CSharpInteroperabilityTests.csproj", "{C10C0225-FBBA-4E3C-99FD-FA4A2BCBB3B1}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "StrongNameTests", "tests\CoreTests\StrongNameTests\StrongNameTests.fsproj", "{32E187BB-D1D4-4864-A021-55A7A08E17EC}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ImageExportTests", "tests\ExtensionLibsTests\ImageExportTests\ImageExportTests.fsproj", "{A3693DD1-4D34-4B10-B310-07A4C7433F7D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpTests", "tests\ExtensionLibsTests\CSharpTests\CSharpTests.csproj", "{1170E3A9-D83E-40B0-8D51-20485C76BE88}"
Expand Down Expand Up @@ -294,12 +292,6 @@ Global
{C10C0225-FBBA-4E3C-99FD-FA4A2BCBB3B1}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{C10C0225-FBBA-4E3C-99FD-FA4A2BCBB3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C10C0225-FBBA-4E3C-99FD-FA4A2BCBB3B1}.Release|Any CPU.Build.0 = Release|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Dotnet|Any CPU.Build.0 = Debug|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32E187BB-D1D4-4864-A021-55A7A08E17EC}.Release|Any CPU.Build.0 = Release|Any CPU
{A3693DD1-4D34-4B10-B310-07A4C7433F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3693DD1-4D34-4B10-B310-07A4C7433F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3693DD1-4D34-4B10-B310-07A4C7433F7D}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -345,7 +337,6 @@ Global
{598AB47B-EFE7-414A-B6EA-8C96B4AA7A4C} = {E8897848-2EF4-4126-9315-ADE0BA92D951}
{DA7BC908-7DC9-4BA7-8100-17D3FD2901EA} = {023425D8-B375-45ED-A29A-A3ED00C0E2BC}
{C10C0225-FBBA-4E3C-99FD-FA4A2BCBB3B1} = {023425D8-B375-45ED-A29A-A3ED00C0E2BC}
{32E187BB-D1D4-4864-A021-55A7A08E17EC} = {023425D8-B375-45ED-A29A-A3ED00C0E2BC}
{A3693DD1-4D34-4B10-B310-07A4C7433F7D} = {02886FBB-DB32-4BBB-A93C-E13EBF453ACC}
{1170E3A9-D83E-40B0-8D51-20485C76BE88} = {02886FBB-DB32-4BBB-A93C-E13EBF453ACC}
{6CFE1FBD-0999-4704-9F79-8A3D31580477} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8}
Expand Down
Empty file modified build.sh
100644 → 100755
Empty file.
24 changes: 11 additions & 13 deletions build/BasicTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ open BlackFox.Fake
open Fake.IO
open Fake.DotNet
open Fake.IO.Globbing.Operators

open System
open ProjectInfo

/// Buildtask for setting a prerelease tag (also sets the mutable isPrerelease to true, and the PackagePrereleaseTag of all project infos accordingly.)
let setPrereleaseTag =
BuildTask.create "SetPrereleaseTag" [] {
printfn "Please enter pre-release package suffix"
let suffix = System.Console.ReadLine()
let suffix = Helpers.getSuffix()
prereleaseSuffix <- suffix
isPrerelease <- true
projects
|> List.iter (fun p ->
p.PackagePrereleaseTag <- (sprintf "%s-%s" p.PackageVersionTag suffix)
)
//
//
prereleaseTag <- (sprintf "%s-%s" CoreProject.PackageVersionTag suffix)
}

Expand All @@ -30,20 +28,20 @@ let clean =

/// builds the solution file (dotnet build solution.sln)
let buildSolution =
BuildTask.create "BuildSolution" [ clean ] {
solutionFile
BuildTask.create "BuildSolution" [ clean ] {
solutionFile
|> DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
{p.MSBuildParams with
Properties = ([
"warnon", "3390"
])
DisableInternalBinLog = true
}
{
p with
p with
MSBuildParams = msBuildParams

}
|> DotNet.Options.withCustomParams (Some "-tl")
)
Expand All @@ -63,7 +61,7 @@ let build = BuildTask.create "Build" [clean] {
proj
|> DotNet.build (fun p ->
let msBuildParams =
{p.MSBuildParams with
{p.MSBuildParams with
Properties = ([
"AssemblyVersion", pInfo.AssemblyVersion
"InformationalVersion", pInfo.AssemblyInformationalVersion
Expand All @@ -72,10 +70,10 @@ let build = BuildTask.create "Build" [clean] {
DisableInternalBinLog = true
}
{
p with
p with
MSBuildParams = msBuildParams
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies -tl")
)
)
}
}
27 changes: 27 additions & 0 deletions build/Helpers.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Helpers

open System.Diagnostics
open BlackFox.Fake
open Fake.Core
open Fake.DotNet
Expand Down Expand Up @@ -32,3 +33,29 @@ let runOrDefault defaultTarget args =
| e ->
printfn "%A" e
1

let isChromeInstalled() =
try
use _process = new Process()
_process.StartInfo.FileName <- "chrome"
_process.StartInfo.Arguments <- "--version"
_process.StartInfo.UseShellExecute <- false
_process.StartInfo.RedirectStandardOutput <- true
_process.Start() |> ignore
_process.WaitForExit()
true
with
| _ -> false

let getSuffix() =
match System.Environment.GetCommandLineArgs() |> Array.tryFind (_.StartsWith("--prerelease-suffix=")) with
| Some arg -> arg.Split('=').[1]
| None ->
printfn "Please enter pre-release package suffix"
System.Console.ReadLine()

let nonInteractive() =
match System.Environment.GetCommandLineArgs() |> Array.tryFind (_.StartsWith("--non-interactive")) with
| Some arg -> true
| None ->
false
21 changes: 12 additions & 9 deletions build/MessagePrompts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ let prompt (msg: string) =
|> Option.map (fun s -> s.Replace("\"", "\\\""))

let rec promptYesNo msg =
match prompt (sprintf "%s [Yn]: " msg) with
| Some "Y"
| Some "y" -> true
| Some "N"
| Some "n" -> false
| _ ->
System.Console.WriteLine("Sorry, invalid answer")
promptYesNo msg
if Helpers.nonInteractive() then
true
else
match prompt (sprintf "%s [Yn]: " msg) with
| Some "Y"
| Some "y" -> true
| Some "N"
| Some "n" -> false
| _ ->
System.Console.WriteLine("Sorry, invalid answer")
promptYesNo msg

let releaseMsg =
"""This will stage all uncommitted changes, push them to the origin and bump the release version to the latest number in the RELEASE_NOTES.md file.
"""This will stage all uncommitted changes, push them to the origin and bump the release version to the latest number in the RELEASE_NOTES.md file.
Do you want to continue?"""

let releaseDocsMsg =
Expand Down
7 changes: 3 additions & 4 deletions build/PackageTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let pack = BuildTask.create "Pack" [ clean; build; runTestsAll ] {
@ p.MSBuildParams.Properties)
DisableInternalBinLog = true
}


{ p with
MSBuildParams = msBuildParams
Expand All @@ -68,8 +68,7 @@ let packPrerelease =
] {
projects
|> List.iter (fun pInfo ->
printfn $"Please enter pre-release package suffix for {pInfo.Name}"
let prereleaseSuffix = System.Console.ReadLine()
let prereleaseSuffix = Helpers.getSuffix()
pInfo.PackagePrereleaseTag <- sprintf "%s-%s" pInfo.PackageVersionTag prereleaseSuffix
if promptYesNo $"creating prerelease package for {pInfo.Name}{System.Environment.NewLine}\tpackage version: {pInfo.PackagePrereleaseTag}{System.Environment.NewLine}\tassembly version: {pInfo.AssemblyVersion}{System.Environment.NewLine}\tassembly informational version: {pInfo.AssemblyInformationalVersion}{System.Environment.NewLine} OK?" then
pInfo.ProjFile
Expand All @@ -88,7 +87,7 @@ let packPrerelease =
])
DisableInternalBinLog = true
}
| _ ->
| _ ->
{ p.MSBuildParams with
Properties =
([
Expand Down
15 changes: 6 additions & 9 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ type ProjectInfo = {
mutable PackagePrereleaseTag: string
AssemblyVersion: string
AssemblyInformationalVersion: string
} with
} with
/// creates a ProjectInfo given a name, project file path, and release notes file path.
/// version info is created from the version header of the uppermost release notes entry.
/// Assembly version is set to X.0.0, where X is the major version from the releas enotes.
static member create(
name: string,
projFile: string,
releaseNotesPath: string
): ProjectInfo =
): ProjectInfo =
let release = releaseNotesPath |> ReleaseNotes.load
let stableVersion = release.NugetVersion |> SemVer.parse
let stableVersionTag = $"{stableVersion.Major}.{stableVersion.Minor}.{stableVersion.Patch}"
Expand All @@ -33,11 +33,11 @@ type ProjectInfo = {
PackageVersionTag = stableVersionTag
AssemblyVersion = assemblyVersion
AssemblyInformationalVersion = assemblyInformationalVersion
}
}
static member create(
name: string,
projFile: string
): ProjectInfo =
): ProjectInfo =
{
Name = name
ProjFile = projFile
Expand Down Expand Up @@ -86,16 +86,13 @@ let CSharpTestProject = ProjectInfo.create("CSharpTests", "tests/ExtensionLibsTe

///
let testProjectsExtensionsLibs = [
ImageExportTestProject
if Helpers.isChromeInstalled() then ImageExportTestProject
CSharpTestProject
]

// test projects (.NET framework)
let StrongNameTestProject = ProjectInfo.create("StrongNameTests", "tests/CoreTests/StrongNameTests/StrongNameTests.fsproj")

let testProjectsNetFX = [
StrongNameTestProject
]
let testProjectsNetFX = [ ]

let CoreProject = ProjectInfo.create("Plotly.NET", "src/Plotly.NET/Plotly.NET.fsproj", "src/Plotly.NET/RELEASE_NOTES.md")
let InteractiveProject = ProjectInfo.create("Plotly.NET.Interactive", "src/Plotly.NET.Interactive/Plotly.NET.Interactive.fsproj", "src/Plotly.NET.Interactive/RELEASE_NOTES.md")
Expand Down
4 changes: 2 additions & 2 deletions build/ReleaseTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let publishNuget =

if promptYesNo "OK?" then
let source =
"https://api.nuget.org/v3/index.json"
Environment.environVarOrDefault "NUGET_SOURCE" "https://api.nuget.org/v3/index.json"

let apikey =
Environment.environVar "NUGET_KEY"
Expand Down Expand Up @@ -102,7 +102,7 @@ let publishNugetPrerelease =

if promptYesNo "OK?" then
let source =
"https://api.nuget.org/v3/index.json"
Environment.environVarOrDefault "NUGET_SOURCE" "https://api.nuget.org/v3/index.json"

let apikey =
Environment.environVar "NUGET_KEY"
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-cone-charts.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 4
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-isosurface-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 7
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-mesh-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 3
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-scatter-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ index: 1
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-streamtube-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 5
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../data/Deedle.dll"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-surface-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 2
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/3D-charts/3d-volume-plots.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index: 6
(*** condition: prepare ***)
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine, 2.0.0-alpha-1"
#r "../../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
2 changes: 1 addition & 1 deletion docs/404.fsx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#r "nuget: FsHttp"
#r "nuget: Newtonsoft.JSON, 13.0.1"
#r "nuget: DynamicObj, 2.0.0"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha1"
#r "nuget: Giraffe.ViewEngine.StrongName, 2.0.0-alpha-1"
#r "../src/Plotly.NET/bin/Release/netstandard2.0/Plotly.NET.dll"

Plotly.NET.Defaults.DefaultDisplayOptions <-
Expand Down
Loading