From 3c36a2e44d9715a8db1e7abd74e890181460ddaf Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Mon, 20 Jul 2020 12:35:16 +0300 Subject: [PATCH 1/9] Adding github workflow file. --- .github/workflows/dotnet-core.yml | 73 ++++++++++++++++++++++++++ .github/workflows/dotnet-framework.yml | 46 ++++++++++++++++ build.fsx | 6 +-- paket.dependencies | 2 +- paket.lock | 2 +- 5 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dotnet-core.yml create mode 100644 .github/workflows/dotnet-framework.yml diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml new file mode 100644 index 0000000..fa7166d --- /dev/null +++ b/.github/workflows/dotnet-core.yml @@ -0,0 +1,73 @@ +name: .NET Core + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + # Stop wasting time caching packages + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + # Disable sending usage data to Microsoft + DOTNET_CLI_TELEMETRY_OPTOUT: true + # Project name to pack and publish + PROJECT_NAME: DynamicsCRMProvider + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a two jobs called "windows" and "mono" + windows: + + # The type of runner that the job will run on + runs-on: windows-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Setup .net core + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + # Build project using a specific script + - name: Build + shell: cmd + run: call .\build.cmd + + # Publish artifacts resulted from build + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: DLL Build Result + path: ./.fake/*.dll + mono: + + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest ] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Setup .net core + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + + # Build project using a specific script + - name: Build + shell: bash + run: | + chmod +x ./build.sh + ./build.sh \ No newline at end of file diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml new file mode 100644 index 0000000..73d2d4a --- /dev/null +++ b/.github/workflows/dotnet-framework.yml @@ -0,0 +1,46 @@ +name: dotnet-framework + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: windows-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Setup MSBuild + - name: setup MSBuild + uses: microsoft/setup-msbuild@v1 + + # Setup Nuget + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.2 + + # Restore Nuget packages for project + - name: Restore Packages + run: nuget restore DynamicsCRMProvider.sln + + # Build project using a specific script + - name: Build + shell: cmd + run: call .\build.cmd + + # Publish artifacts resulted from build + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: DLL Build Result + path: ./bin/*.dll diff --git a/build.fsx b/build.fsx index 9459c9b..f9eadff 100644 --- a/build.fsx +++ b/build.fsx @@ -85,10 +85,10 @@ Target "AssemblyInfo" (fun _ -> Attribute.FileVersion release.AssemblyVersion ] let getProjectDetails projectPath = - let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) + let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath: string) ( projectPath, projectName, - System.IO.Path.GetDirectoryName(projectPath), + System.IO.Path.GetDirectoryName(projectPath: string), (getAssemblyInfoAttributes projectName) ) @@ -318,7 +318,7 @@ Target "ReleaseDocs" (fun _ -> Branches.push tempDocsDir ) -#load "paket-files/fsharp/FAKE/modules/Octokit/Octokit.fsx" +#load "paket-files/FoothillSolutions/FAKE/modules/Octokit/Octokit.fsx" open Octokit Target "Release" (fun _ -> diff --git a/paket.dependencies b/paket.dependencies index e91fdff..885cfbb 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -8,6 +8,6 @@ nuget FAKE 4.64.18 nuget SourceLink.Fake nuget Microsoft.CrmSdk.CoreAssemblies -github FoothillSolutions/FAKE modules/Octokit/Octokit.fsx +github FoothillSolutions/FAKE:release/next modules/Octokit/Octokit.fsx github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fsi github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs \ No newline at end of file diff --git a/paket.lock b/paket.lock index 4382223..377f36d 100644 --- a/paket.lock +++ b/paket.lock @@ -24,7 +24,7 @@ NUGET SourceLink.Fake (1.1) GITHUB remote: FoothillSolutions/FAKE - modules/Octokit/Octokit.fsx (74421063dd3915e8e1e407926b38b8b25df50e36) + modules/Octokit/Octokit.fsx (62cbd242f336419aad54a5d9e797282be675f84d) Octokit (>= 0.20) remote: fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs (b45779c1571b54a2bc6bafa12690a8d9763150d1) From 4f126514262b7bffb7600b7e4abc7a095b4ad13d Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 12:25:27 +0300 Subject: [PATCH 2/9] uncomment steps. --- build.fsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.fsx b/build.fsx index f9eadff..31754c3 100644 --- a/build.fsx +++ b/build.fsx @@ -349,10 +349,10 @@ Target "All" DoNothing ==> "Build" ==> "CopyBinaries" // ==> "RunTests" -// =?> ("GenerateReferenceDocs",isLocalBuild) -// =?> ("GenerateDocs",isLocalBuild) -// ==> "All" -// =?> ("ReleaseDocs",isLocalBuild) + =?> ("GenerateReferenceDocs",isLocalBuild) + =?> ("GenerateDocs",isLocalBuild) + ==> "All" + =?> ("ReleaseDocs",isLocalBuild) "All" #if MONO From eafbf57f65167e248c5c1307e93b936d8342a227 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 12:31:24 +0300 Subject: [PATCH 3/9] comment docs steps. add bin directory as restination. --- .github/workflows/dotnet-framework.yml | 6 +----- build.fsx | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml index 73d2d4a..267183c 100644 --- a/.github/workflows/dotnet-framework.yml +++ b/.github/workflows/dotnet-framework.yml @@ -29,10 +29,6 @@ jobs: - name: Setup NuGet uses: NuGet/setup-nuget@v1.0.2 - # Restore Nuget packages for project - - name: Restore Packages - run: nuget restore DynamicsCRMProvider.sln - # Build project using a specific script - name: Build shell: cmd @@ -43,4 +39,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: DLL Build Result - path: ./bin/*.dll + path: ./bin diff --git a/build.fsx b/build.fsx index 31754c3..003aace 100644 --- a/build.fsx +++ b/build.fsx @@ -349,10 +349,10 @@ Target "All" DoNothing ==> "Build" ==> "CopyBinaries" // ==> "RunTests" - =?> ("GenerateReferenceDocs",isLocalBuild) - =?> ("GenerateDocs",isLocalBuild) +// =?> ("GenerateReferenceDocs",isLocalBuild) +// =?> ("GenerateDocs",isLocalBuild) ==> "All" - =?> ("ReleaseDocs",isLocalBuild) +// =?> ("ReleaseDocs",isLocalBuild) "All" #if MONO From c74d5e6bf5ddc71805f55f39902c7a3880e9f065 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 14:51:57 +0300 Subject: [PATCH 4/9] add helper to generate docs. --- build.fsx | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/build.fsx b/build.fsx index 003aace..d953f33 100644 --- a/build.fsx +++ b/build.fsx @@ -203,7 +203,7 @@ Target "PublishNuget" (fun _ -> // Generate the documentation Target "GenerateReferenceDocs" (fun _ -> - if not <| executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then + if not <| fakeStartInfo "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then failwith "generating reference documentation failed" ) @@ -211,7 +211,7 @@ let generateHelp' fail debug = let args = if debug then ["--define:HELP"] else ["--define:RELEASE"; "--define:HELP"] - if executeFSIWithArgs "docs/tools" "generate.fsx" args [] then + if fakeStartInfo "docs/tools" "generate.fsx" args [] then traceImportant "Help generated" else if fail then @@ -304,6 +304,22 @@ Target "AddLangDocs" (fun _ -> createIndexFsx lang) ) +let fakePath = "packages" "FAKE" "tools" "FAKE.exe" +let fakeStartInfo script workingDirectory args fsiargs environmentVars = + //(fun (info: System.Diagnostics.ProcessStartInfo) -> + (fun (info: ProcStartInfo) -> + { info with + FileName = System.IO.Path.GetFullPath fakePath + Arguments = sprintf "%s --fsiargs -d:FAKE %s \"%s\"" args fsiargs script + WorkingDirectory = workingDirectory + Environment = + [ "MSBuild", msBuildExe + "GIT", Git.CommandHelper.gitPath + "FSI", Fake.FSIHelper.fsiPath + ] |> Map.ofList |> Some + } + ) + // -------------------------------------------------------------------------------------- // Release Scripts @@ -349,10 +365,10 @@ Target "All" DoNothing ==> "Build" ==> "CopyBinaries" // ==> "RunTests" -// =?> ("GenerateReferenceDocs",isLocalBuild) -// =?> ("GenerateDocs",isLocalBuild) + =?> ("GenerateReferenceDocs",isLocalBuild) + =?> ("GenerateDocs",isLocalBuild) ==> "All" -// =?> ("ReleaseDocs",isLocalBuild) + =?> ("ReleaseDocs",isLocalBuild) "All" #if MONO From 0b93b73f0c3e58c17ac14f8cac74c5b60b61cc5b Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 15:02:43 +0300 Subject: [PATCH 5/9] revert --- build.fsx | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/build.fsx b/build.fsx index d953f33..31754c3 100644 --- a/build.fsx +++ b/build.fsx @@ -203,7 +203,7 @@ Target "PublishNuget" (fun _ -> // Generate the documentation Target "GenerateReferenceDocs" (fun _ -> - if not <| fakeStartInfo "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then + if not <| executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then failwith "generating reference documentation failed" ) @@ -211,7 +211,7 @@ let generateHelp' fail debug = let args = if debug then ["--define:HELP"] else ["--define:RELEASE"; "--define:HELP"] - if fakeStartInfo "docs/tools" "generate.fsx" args [] then + if executeFSIWithArgs "docs/tools" "generate.fsx" args [] then traceImportant "Help generated" else if fail then @@ -304,22 +304,6 @@ Target "AddLangDocs" (fun _ -> createIndexFsx lang) ) -let fakePath = "packages" "FAKE" "tools" "FAKE.exe" -let fakeStartInfo script workingDirectory args fsiargs environmentVars = - //(fun (info: System.Diagnostics.ProcessStartInfo) -> - (fun (info: ProcStartInfo) -> - { info with - FileName = System.IO.Path.GetFullPath fakePath - Arguments = sprintf "%s --fsiargs -d:FAKE %s \"%s\"" args fsiargs script - WorkingDirectory = workingDirectory - Environment = - [ "MSBuild", msBuildExe - "GIT", Git.CommandHelper.gitPath - "FSI", Fake.FSIHelper.fsiPath - ] |> Map.ofList |> Some - } - ) - // -------------------------------------------------------------------------------------- // Release Scripts From 6ce95553cf234ca05c98ee0bff6590ab9a59ef4c Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 15:39:52 +0300 Subject: [PATCH 6/9] try docs generation --- .github/workflows/dotnet-framework.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-framework.yml b/.github/workflows/dotnet-framework.yml index 267183c..b40bb51 100644 --- a/.github/workflows/dotnet-framework.yml +++ b/.github/workflows/dotnet-framework.yml @@ -1,4 +1,4 @@ -name: dotnet-framework +name: .NET Framework # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch From 8336c28d54c5946035c77b16eddb572b610d35ac Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 15:59:58 +0300 Subject: [PATCH 7/9] reference foothill fake repo. --- paket.dependencies | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paket.dependencies b/paket.dependencies index 885cfbb..d76513d 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -4,10 +4,9 @@ source https://nuget.org/api/v2 nuget FSharp.Formatting nuget NUnit nuget NUnit.Runners -nuget FAKE 4.64.18 nuget SourceLink.Fake nuget Microsoft.CrmSdk.CoreAssemblies -github FoothillSolutions/FAKE:release/next modules/Octokit/Octokit.fsx +github FoothillSolutions/FAKE:release/next github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fsi github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs \ No newline at end of file From dfe5930792ce5edabba112f7e2aa10a4958763b4 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 16:09:11 +0300 Subject: [PATCH 8/9] sync .lock file. --- paket.lock | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paket.lock b/paket.lock index 377f36d..653dbcd 100644 --- a/paket.lock +++ b/paket.lock @@ -1,7 +1,6 @@ RESTRICTION: == net462 NUGET remote: https://www.nuget.org/api/v2 - FAKE (4.64.18) FSharp.Formatting (4.1) Microsoft.CrmSdk.CoreAssemblies (9.0.2.26) NUnit (3.12) @@ -24,8 +23,7 @@ NUGET SourceLink.Fake (1.1) GITHUB remote: FoothillSolutions/FAKE - modules/Octokit/Octokit.fsx (62cbd242f336419aad54a5d9e797282be675f84d) - Octokit (>= 0.20) + Octokit (>= 0.20) remote: fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs (b45779c1571b54a2bc6bafa12690a8d9763150d1) src/ProvidedTypes.fsi (b45779c1571b54a2bc6bafa12690a8d9763150d1) \ No newline at end of file From e76be02b74791b5594c932eb3e46860a88a731b2 Mon Sep 17 00:00:00 2001 From: YazeedObaid Date: Tue, 21 Jul 2020 16:27:38 +0300 Subject: [PATCH 9/9] try --- paket.dependencies | 1 + paket.lock | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/paket.dependencies b/paket.dependencies index d76513d..db94bab 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -8,5 +8,6 @@ nuget SourceLink.Fake nuget Microsoft.CrmSdk.CoreAssemblies github FoothillSolutions/FAKE:release/next +github FoothillSolutions/FAKE:release/next modules/Octokit/Octokit.fsx github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fsi github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs \ No newline at end of file diff --git a/paket.lock b/paket.lock index 653dbcd..9573c4b 100644 --- a/paket.lock +++ b/paket.lock @@ -23,7 +23,9 @@ NUGET SourceLink.Fake (1.1) GITHUB remote: FoothillSolutions/FAKE - Octokit (>= 0.20) + remote: FoothillSolutions/FAKE + modules/Octokit/Octokit.fsx (62cbd242f336419aad54a5d9e797282be675f84d) + Octokit (>= 0.20) remote: fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs (b45779c1571b54a2bc6bafa12690a8d9763150d1) src/ProvidedTypes.fsi (b45779c1571b54a2bc6bafa12690a8d9763150d1) \ No newline at end of file