Skip to content

Commit

Permalink
Merge pull request #91 from Arkatufus/master
Browse files Browse the repository at this point in the history
Fix build script
  • Loading branch information
Arkatufus authored Sep 29, 2021
2 parents fbd1bdf + 294e9d7 commit e18fbc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 67 deletions.
4 changes: 3 additions & 1 deletion build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ trigger:
include:
- refs/tags/*

pr: none

variables:
- group: signingSecrets #create this group with SECRET variables `signingUsername` and `signingPassword`
- group: nugetKeys #create this group with SECRET variables `nugetKey`
- name: githubConnectionName
value: AkkaDotNet_Releases
- name: projectName
value: Akka.MultiNodeTestRunner
value: Akka.MultiNode.TestAdapter
- name: githubRepositoryName
value: akkadotnet/Akka.MultiNodeTestRunner

Expand Down
70 changes: 4 additions & 66 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,82 +224,21 @@ let overrideVersionSuffix (project:string) =
| _ -> versionSuffix // add additional matches to publish different versions for different projects in solution

Target "CreateNuget" (fun _ ->
let projects = !! "src/**/*.csproj"
-- "src/**/*Tests.csproj" // Don't publish unit tests
-- "src/**/*Tests*.csproj"
-- "src/**/*.MultiNode.TestAdapter.csproj" // Do not publish MNTR nuget packages
-- "src/**/*.MultiNode.NodeRunner.csproj"
-- "src/**/*.MultiNode.Shared.csproj"
-- "src/**/*.MultiNode.TestRunner.Shared.csproj"
let projects = !! "src/**/*.MultiNode.TestAdapter.csproj"

let runSingleProject project =
DotNetCli.Pack
(fun p ->
{ p with
Project = project
Configuration = configuration
AdditionalArgs = ["--include-symbols --no-build"]
AdditionalArgs = ["--include-symbols"]
VersionSuffix = overrideVersionSuffix project
OutputPath = outputNuGet })

projects |> Seq.iter (runSingleProject)
)

Target "PublishMntr" (fun _ ->
let executableProjects = !! "./src/**/Akka.MultiNode.TestAdapter.csproj"
let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else []

executableProjects |> Seq.iter (fun project ->
DotNetCli.Restore
(fun p ->
{ p with
Project = project
AdditionalArgs = additionalArgs })
)

executableProjects |> Seq.iter (fun project ->
DotNetCli.Publish
(fun p ->
{ p with
Project = project
Configuration = configuration
Framework = "netstandard2.0"
VersionSuffix = versionSuffix }))
)

Target "CreateMntrNuget" (fun _ ->

let commonPropsVersionPrefix = XMLRead true "./src/common.props" "" "" "//Project/PropertyGroup/VersionPrefix" |> Seq.head
let versionReplacement = List.ofSeq [ "@version@", commonPropsVersionPrefix + (if (not (versionSuffix = "")) then ("-" + versionSuffix) else "") ]

// uses the template file to create a temporary .nuspec file with the correct version
let generateNuspec (nuspecTemplatePath : string) =
let nuspecPath = nuspecTemplatePath.Replace(".template", "")
CopyFile nuspecPath nuspecTemplatePath
TemplateHelper.processTemplates versionReplacement [ nuspecPath ]
nuspecPath

let nuspecTemplates = [
"./src/Akka.MultiNode.TestAdapter/Akka.MultiNode.TestAdapter.nuspec.template"
]
let nuspecFiles = List.map (generateNuspec) nuspecTemplates

let executableProjects = !! "./src/**/Akka.MultiNode.TestAdapter.csproj"

executableProjects |> Seq.iter (fun project ->
DotNetCli.Pack
(fun p ->
{ p with
Project = project
Configuration = configuration
AdditionalArgs = ["--include-symbols"]
VersionSuffix = versionSuffix
OutputPath = "\"" + outputNuGet + "\"" } )
)

nuspecFiles |> Seq.iter (DeleteFile)
)

Target "PublishNuget" (fun _ ->
let projects = !! "./bin/nuget/*.nupkg"
let apiKey = getBuildParamOrDefault "nugetkey" ""
Expand Down Expand Up @@ -377,15 +316,14 @@ Target "All" DoNothing
Target "Nuget" DoNothing

// build dependencies
"Clean" ==> "AssemblyInfo" ==> "Build"
"Build" ==> "PublishMntr" ==> "BuildRelease"
"Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease"

// tests dependencies
"Build" ==> "RunTests"
"Build" ==> "RunTestsNet"

// nuget dependencies
"BuildRelease" ==> "CreateMntrNuget" ==> "CreateNuget"
"Clean" ==> "Build" ==> "CreateNuget"
"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget"

// docs
Expand Down

0 comments on commit e18fbc0

Please sign in to comment.