Skip to content

Commit ef51916

Browse files
committed
Fixed applying /p:ContinuousIntegrationBuild=true and implemented --embed-all --ci-build build arguments
1 parent 3cbe349 commit ef51916

File tree

3 files changed

+87
-62
lines changed

3 files changed

+87
-62
lines changed

.github/workflows/publish_ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,68 +54,68 @@ jobs:
5454
run: dotnet tool restore
5555

5656
- name: Run integration tests
57-
run: dotnet run --project build/Build.fsproj
57+
run: dotnet run --project build/Build.fsproj -- --embed-all --ci-build
5858

5959
- name: Pack FSharp.Data.GraphQL.Shared project
6060
run: |
6161
cd src/FSharp.Data.GraphQL.Shared
62-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
62+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
6363
- name: Publish FSharp.Data.GraphQL.Shared package to GitHub
6464
run: |
6565
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
6666
6767
- name: Pack FSharp.Data.GraphQL.Client project
6868
run: |
6969
cd src/FSharp.Data.GraphQL.Client
70-
dotnet pack --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
70+
dotnet pack --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
7171
- name: Publish FSharp.Data.GraphQL.Client package to GitHub
7272
run: |
7373
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
7474
7575
- name: Pack FSharp.Data.GraphQL.Server project
7676
run: |
7777
cd src/FSharp.Data.GraphQL.Server
78-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
78+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
7979
- name: Publish FSharp.Data.GraphQL.Server package to GitHub
8080
run: |
8181
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
8282
8383
- name: Pack FSharp.Data.GraphQL.Server.AspNetCore project
8484
run: |
8585
cd src/FSharp.Data.GraphQL.Server.AspNetCore
86-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
86+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
8787
- name: Publish FSharp.Data.GraphQL.Server.AspNetCore package to GitHub
8888
run: |
8989
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.AspNetCore.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
9090
9191
- name: Pack FSharp.Data.GraphQL.Server.Giraffe project
9292
run: |
9393
cd src/FSharp.Data.GraphQL.Server.Giraffe
94-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
94+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
9595
- name: Publish FSharp.Data.GraphQL.Server.Giraffe package to GitHub
9696
run: |
9797
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Giraffe.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
9898
9999
- name: Pack FSharp.Data.GraphQL.Server.Oxpecker project
100100
run: |
101101
cd src/FSharp.Data.GraphQL.Server.Oxpecker
102-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
102+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
103103
- name: Publish FSharp.Data.GraphQL.Server.Oxpecker package to GitHub
104104
run: |
105105
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Oxpecker.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
106106
107107
- name: Pack FSharp.Data.GraphQL.Server.Relay project
108108
run: |
109109
cd src/FSharp.Data.GraphQL.Server.Relay
110-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
110+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
111111
- name: Publish FSharp.Data.GraphQL.Server.Relay package to GitHub
112112
run: |
113113
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
114114
115115
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
116116
run: |
117117
cd src/FSharp.Data.GraphQL.Server.Middleware
118-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
118+
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
119119
- name: Publish FSharp.Data.GraphQL.Server.Middleware package to GitHub
120120
run: |
121121
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
@@ -128,7 +128,7 @@ jobs:
128128
- name: Pack FSharp.Data.GraphQL.ProjectTemplates template project
129129
run: |
130130
cd samples
131-
dotnet pack --configuration Release /p:ContinuousIntegrationBuild=true -o ../nuget
131+
dotnet pack --configuration Release -o ../nuget
132132
- name: Publish FSharp.Data.GraphQL.ProjectTemplates package to GitHub
133133
run: |
134134
$path = "nuget/FSharp.Data.GraphQL.ProjectTemplates.${{env.VERSION}}.nupkg"

.github/workflows/publish_release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ jobs:
5454
run: dotnet tool restore
5555

5656
- name: Run integration tests
57-
run: dotnet run --project build/Build.fsproj
57+
run: dotnet run --project build/Build.fsproj -- --ci-build
5858

5959
- name: Pack FSharp.Data.GraphQL.Shared project
6060
run: |
6161
cd src/FSharp.Data.GraphQL.Shared
62-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
62+
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
6363
- name: Publish FSharp.Data.GraphQL.Shared package to NuGet
6464
run: |
6565
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -70,7 +70,7 @@ jobs:
7070
- name: Pack FSharp.Data.GraphQL.Client project
7171
run: |
7272
cd src/FSharp.Data.GraphQL.Client
73-
dotnet pack --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
73+
dotnet pack --configuration Release /p:IsNuGet=true -o ../../nuget
7474
- name: Publish FSharp.Data.GraphQL.Client package to NuGet
7575
run: |
7676
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -79,7 +79,7 @@ jobs:
7979
- name: Pack FSharp.Data.GraphQL.Server project
8080
run: |
8181
cd src/FSharp.Data.GraphQL.Server
82-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
82+
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
8383
- name: Publish FSharp.Data.GraphQL.Server package to NuGet
8484
run: |
8585
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -88,7 +88,7 @@ jobs:
8888
- name: Pack FSharp.Data.GraphQL.Server.AspNetCore project
8989
run: |
9090
cd src/FSharp.Data.GraphQL.Server.AspNetCore
91-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
91+
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
9292
- name: Publish FSharp.Data.GraphQL.Server.AspNetCore package to NuGet
9393
run: |
9494
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.AspNetCore.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -97,7 +97,7 @@ jobs:
9797
- name: Pack FSharp.Data.GraphQL.Server.Giraffe project
9898
run: |
9999
cd src/FSharp.Data.GraphQL.Server.Giraffe
100-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
100+
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
101101
- name: Publish FSharp.Data.GraphQL.Server.Giraffe package to NuGet
102102
run: |
103103
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Giraffe.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -106,7 +106,7 @@ jobs:
106106
- name: Pack FSharp.Data.GraphQL.Server.Oxpecker project
107107
run: |
108108
cd src/FSharp.Data.GraphQL.Server.Oxpecker
109-
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
109+
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
110110
- name: Publish FSharp.Data.GraphQL.Server.Oxpecker package to NuGet
111111
run: |
112112
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Oxpecker.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -115,7 +115,7 @@ jobs:
115115
- name: Pack FSharp.Data.GraphQL.Server.Relay project
116116
run: |
117117
cd src/FSharp.Data.GraphQL.Server.Relay
118-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
118+
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
119119
- name: Publish FSharp.Data.GraphQL.Server.Relay package to NuGet
120120
run: |
121121
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -124,7 +124,7 @@ jobs:
124124
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
125125
run: |
126126
cd src/FSharp.Data.GraphQL.Server.Middleware
127-
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
127+
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
128128
- name: Publish FSharp.Data.GraphQL.Server.Middleware package to NuGet
129129
run: |
130130
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
@@ -138,7 +138,7 @@ jobs:
138138
- name: Pack FSharp.Data.GraphQL.ProjectTemplates template project
139139
run: |
140140
cd samples
141-
dotnet pack --configuration Release /p:ContinuousIntegrationBuild=true -o ../nuget
141+
dotnet pack --configuration Release -o ../nuget
142142
- name: Publish FSharp.Data.GraphQL.ProjectTemplates package to NuGet
143143
run: |
144144
$path = "nuget/FSharp.Data.GraphQL.ProjectTemplates.${{env.VERSION}}.nupkg"

build/Program.fs

Lines changed: 67 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ execContext
2424
|> Fake.Core.Context.RuntimeContext.Fake
2525
|> Fake.Core.Context.setExecutionContext
2626

27+
module BuildArguments =
28+
let [<Literal>] EmbedAll = "--embed-all"
29+
let [<Literal>] CIBuild = "--ci-build"
30+
let [<Literal>] SkipDuplicate = "--skip-duplicate"
31+
32+
let ctx = Context.forceFakeContext ()
33+
let embedAll = ctx.Arguments |> List.exists (fun arg -> arg = BuildArguments.EmbedAll)
34+
let ciBuild = ctx.Arguments |> List.exists (fun arg -> arg = BuildArguments.CIBuild)
35+
2736
module DotNetCli =
2837
let setVersion (o : DotNet.Options) = { o with Version = Some "8.0.400" }
2938
let setRestoreOptions (o : DotNet.RestoreOptions) = o.WithCommon setVersion
@@ -71,7 +80,17 @@ Target.create BuildTarget <| fun _ ->
7180
|> DotNet.build (fun options -> {
7281
options with
7382
Configuration = configuration
74-
MSBuildParams = { options.MSBuildParams with DisableInternalBinLog = true }
83+
MSBuildParams = {
84+
options.MSBuildParams with
85+
DisableInternalBinLog = true
86+
Properties = [
87+
if embedAll then
88+
("DebugType", "Embedded")
89+
("EmbedAllSources", "true")
90+
if ciBuild then
91+
("ContinuousIntegrationBuild", "true")
92+
]
93+
}
7594
})
7695

7796
let startGraphQLServer (project : string) port (streamRef : DataRef<Stream>) =
@@ -242,13 +261,20 @@ let pack id =
242261
Shell.cleanDir packageDir
243262

244263
projectPath
245-
|> DotNet.pack (fun p ->
264+
|> DotNet.pack (fun options ->
246265
{
247-
p with
248-
Common = { p.Common with Version = Some release.NugetVersion }
266+
options with
267+
Common = { options.Common with Version = Some release.NugetVersion }
249268
NoLogo = true
250269
OutputPath = Some packageDir
251-
MSBuildParams = { p.MSBuildParams with Properties = [("IsNuget", "true")] }
270+
MSBuildParams = {
271+
options.MSBuildParams with
272+
Properties = [
273+
if embedAll then
274+
("DebugType", "Embedded")
275+
("IsNuget", "true")
276+
]
277+
}
252278
}
253279
.WithCommon
254280
DotNetCli.setVersion)
@@ -276,18 +302,19 @@ let push id =
276302

277303
packageFile
278304
|> DotNet.nugetPush (fun p ->
305+
let skipDuplicate = ctx.Arguments |> List.exists (fun arg -> arg = BuildArguments.SkipDuplicate)
279306
{
280307
p with
281308
Common = { p.Common with WorkingDirectory = packageDir }
282309
PushParams = {
283-
p.PushParams
284-
with
285-
ApiKey = Some (Environment.GetEnvironmentVariable apiKeyVariableName)
286-
Source = source
287-
SkipDuplicate = true
310+
p.PushParams with
311+
ApiKey = Some (Environment.GetEnvironmentVariable apiKeyVariableName)
312+
Source = source
313+
SkipDuplicate = skipDuplicate
288314
}
289315
}
290-
.WithCommon DotNetCli.setVersion)
316+
.WithCommon
317+
DotNetCli.setVersion)
291318

292319
let [<Literal>] PackSharedTarget = "PackShared"
293320
Target.create PackSharedTarget <| fun _ -> pack "Shared"
@@ -345,39 +372,37 @@ Target.create "All" ignore
345372
Target.create "PackAndPush" ignore
346373

347374
"Clean"
348-
==> RestoreTarget
349-
==> BuildTarget
350-
==> RunUnitTestsTarget
351-
==> StartStarWarsServerTarget
352-
==> StartIntegrationServerTarget
353-
==> UpdateIntrospectionFileTarget
354-
==> RunIntegrationTestsTarget
355-
==> "All"
356-
=?> (GenerateDocsTarget, Environment.environVar "GITHUB_ACTIONS" = "True")
357-
|> ignore
358-
359-
"CleanDocs"
360-
==> GenerateDocsTarget
361-
|> ignore
375+
==> RestoreTarget
376+
==> BuildTarget
377+
==> RunUnitTestsTarget
378+
==> StartStarWarsServerTarget
379+
==> StartIntegrationServerTarget
380+
==> UpdateIntrospectionFileTarget
381+
==> RunIntegrationTestsTarget
382+
==> "All"
383+
=?> (GenerateDocsTarget, Environment.environVar "GITHUB_ACTIONS" = "True")
384+
|> ignore
385+
386+
"CleanDocs" ==> GenerateDocsTarget |> ignore
362387

363388
PackSharedTarget
364-
==> PushSharedTarget
365-
==> PackClientTarget
366-
==> PushClientTarget
367-
==> PackServerTarget
368-
==> PushServerTarget
369-
==> PackServerAspNetCore
370-
==> PushServerAspNetCore
371-
==> PackServerGiraffe
372-
==> PushServerGiraffe
373-
==> PackServerOxpecker
374-
==> PushServerOxpecker
375-
==> PackMiddlewareTarget
376-
==> PushMiddlewareTarget
377-
==> PackRelayTarget
378-
==> PushRelayTarget
379-
==> "PackAndPush"
380-
|> ignore
389+
==> PushSharedTarget
390+
==> PackClientTarget
391+
==> PushClientTarget
392+
==> PackServerTarget
393+
==> PushServerTarget
394+
==> PackServerAspNetCore
395+
==> PushServerAspNetCore
396+
==> PackServerGiraffe
397+
==> PushServerGiraffe
398+
==> PackServerOxpecker
399+
==> PushServerOxpecker
400+
==> PackMiddlewareTarget
401+
==> PushMiddlewareTarget
402+
==> PackRelayTarget
403+
==> PushRelayTarget
404+
==> "PackAndPush"
405+
|> ignore
381406

382407
Target.runOrDefaultWithArguments "All"
383408

0 commit comments

Comments
 (0)