Skip to content

Commit

Permalink
Fixed applying /p:ContinuousIntegrationBuild=true and implemented `…
Browse files Browse the repository at this point in the history
…--embed-all --ci-build` build arguments
  • Loading branch information
xperiandri committed Oct 10, 2024
1 parent 3cbe349 commit a87cd19
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 59 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/publish_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,68 +54,68 @@ jobs:
run: dotnet tool restore

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

- name: Pack FSharp.Data.GraphQL.Shared project
run: |
cd src/FSharp.Data.GraphQL.Shared
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Shared package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Client project
run: |
cd src/FSharp.Data.GraphQL.Client
dotnet pack --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Client package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server project
run: |
cd src/FSharp.Data.GraphQL.Server
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.AspNetCore project
run: |
cd src/FSharp.Data.GraphQL.Server.AspNetCore
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.AspNetCore package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.AspNetCore.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Giraffe project
run: |
cd src/FSharp.Data.GraphQL.Server.Giraffe
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Giraffe package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Giraffe.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Oxpecker project
run: |
cd src/FSharp.Data.GraphQL.Server.Oxpecker
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Oxpecker package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Oxpecker.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Relay project
run: |
cd src/FSharp.Data.GraphQL.Server.Relay
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Relay package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
run: |
cd src/FSharp.Data.GraphQL.Server.Middleware
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:DebugType=Embedded -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Middleware package to GitHub
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.nupkg -s "github.com" -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.ProjectTemplates template project
run: |
cd samples
dotnet pack --configuration Release /p:ContinuousIntegrationBuild=true -o ../nuget
dotnet pack --configuration Release -o ../nuget
- name: Publish FSharp.Data.GraphQL.ProjectTemplates package to GitHub
run: |
$path = "nuget/FSharp.Data.GraphQL.ProjectTemplates.${{env.VERSION}}.nupkg"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
run: dotnet tool restore

- name: Run integration tests
run: dotnet run --project build/Build.fsproj
run: dotnet run --project build/Build.fsproj -- --ci-build

- name: Pack FSharp.Data.GraphQL.Shared project
run: |
cd src/FSharp.Data.GraphQL.Shared
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Shared package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Shared.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -70,7 +70,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Client project
run: |
cd src/FSharp.Data.GraphQL.Client
dotnet pack --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --configuration Release /p:IsNuGet=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Client package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Client.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server project
run: |
cd src/FSharp.Data.GraphQL.Server
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -88,7 +88,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server.AspNetCore project
run: |
cd src/FSharp.Data.GraphQL.Server.AspNetCore
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.AspNetCore package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.AspNetCore.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server.Giraffe project
run: |
cd src/FSharp.Data.GraphQL.Server.Giraffe
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Giraffe package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Giraffe.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -106,7 +106,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server.Oxpecker project
run: |
cd src/FSharp.Data.GraphQL.Server.Oxpecker
dotnet pack --no-build --configuration Release /p:IsNuget=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuget=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Oxpecker package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Oxpecker.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -115,7 +115,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server.Relay project
run: |
cd src/FSharp.Data.GraphQL.Server.Relay
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Relay package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Relay.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -124,7 +124,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.Server.Middleware project
run: |
cd src/FSharp.Data.GraphQL.Server.Middleware
dotnet pack --no-build --configuration Release /p:IsNuGet=true /p:ContinuousIntegrationBuild=true -o ../../nuget
dotnet pack --no-build --configuration Release /p:IsNuGet=true -o ../../nuget
- name: Publish FSharp.Data.GraphQL.Server.Middleware package to NuGet
run: |
dotnet nuget push nuget/FSharp.Data.GraphQL.Server.Middleware.${{env.VERSION}}.nupkg -k ${{secrets.NUGET_SECRET}} --skip-duplicate
Expand All @@ -138,7 +138,7 @@ jobs:
- name: Pack FSharp.Data.GraphQL.ProjectTemplates template project
run: |
cd samples
dotnet pack --configuration Release /p:ContinuousIntegrationBuild=true -o ../nuget
dotnet pack --configuration Release -o ../nuget
- name: Publish FSharp.Data.GraphQL.ProjectTemplates package to NuGet
run: |
$path = "nuget/FSharp.Data.GraphQL.ProjectTemplates.${{env.VERSION}}.nupkg"
Expand Down
91 changes: 52 additions & 39 deletions build/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,24 @@ Target.create RestoreTarget <| fun _ ->

let [<Literal>] BuildTarget = "Build"
Target.create BuildTarget <| fun _ ->
let ctx = Context.forceFakeContext ()
let embedAll = ctx.Arguments |> List.exists (fun arg -> arg = "--embed-all")
let ciBuild = ctx.Arguments |> List.exists (fun arg -> arg = "--ci-build")
"FSharp.Data.GraphQL.sln"
|> DotNet.build (fun options -> {
options with
Configuration = configuration
MSBuildParams = { options.MSBuildParams with DisableInternalBinLog = true }
MSBuildParams = {
options.MSBuildParams with
DisableInternalBinLog = true
Properties = [
if embedAll then
("DebugType", "Embedded")
("EmbedAllSources", "true")
if ciBuild then
("ContinuousIntegrationBuild", "true")
]
}
})

let startGraphQLServer (project : string) port (streamRef : DataRef<Stream>) =
Expand Down Expand Up @@ -248,7 +261,9 @@ let pack id =
Common = { p.Common with Version = Some release.NugetVersion }
NoLogo = true
OutputPath = Some packageDir
MSBuildParams = { p.MSBuildParams with Properties = [("IsNuget", "true")] }
MSBuildParams = {
p.MSBuildParams with Properties = [ ("IsNuget", "true") ]
}
}
.WithCommon
DotNetCli.setVersion)
Expand Down Expand Up @@ -280,14 +295,14 @@ let push id =
p with
Common = { p.Common with WorkingDirectory = packageDir }
PushParams = {
p.PushParams
with
ApiKey = Some (Environment.GetEnvironmentVariable apiKeyVariableName)
Source = source
SkipDuplicate = true
p.PushParams with
ApiKey = Some (Environment.GetEnvironmentVariable apiKeyVariableName)
Source = source
SkipDuplicate = true
}
}
.WithCommon DotNetCli.setVersion)
.WithCommon
DotNetCli.setVersion)

let [<Literal>] PackSharedTarget = "PackShared"
Target.create PackSharedTarget <| fun _ -> pack "Shared"
Expand Down Expand Up @@ -345,39 +360,37 @@ Target.create "All" ignore
Target.create "PackAndPush" ignore

"Clean"
==> RestoreTarget
==> BuildTarget
==> RunUnitTestsTarget
==> StartStarWarsServerTarget
==> StartIntegrationServerTarget
==> UpdateIntrospectionFileTarget
==> RunIntegrationTestsTarget
==> "All"
=?> (GenerateDocsTarget, Environment.environVar "GITHUB_ACTIONS" = "True")
|> ignore

"CleanDocs"
==> GenerateDocsTarget
|> ignore
==> RestoreTarget
==> BuildTarget
==> RunUnitTestsTarget
==> StartStarWarsServerTarget
==> StartIntegrationServerTarget
==> UpdateIntrospectionFileTarget
==> RunIntegrationTestsTarget
==> "All"
=?> (GenerateDocsTarget, Environment.environVar "GITHUB_ACTIONS" = "True")
|> ignore

"CleanDocs" ==> GenerateDocsTarget |> ignore

PackSharedTarget
==> PushSharedTarget
==> PackClientTarget
==> PushClientTarget
==> PackServerTarget
==> PushServerTarget
==> PackServerAspNetCore
==> PushServerAspNetCore
==> PackServerGiraffe
==> PushServerGiraffe
==> PackServerOxpecker
==> PushServerOxpecker
==> PackMiddlewareTarget
==> PushMiddlewareTarget
==> PackRelayTarget
==> PushRelayTarget
==> "PackAndPush"
|> ignore
==> PushSharedTarget
==> PackClientTarget
==> PushClientTarget
==> PackServerTarget
==> PushServerTarget
==> PackServerAspNetCore
==> PushServerAspNetCore
==> PackServerGiraffe
==> PushServerGiraffe
==> PackServerOxpecker
==> PushServerOxpecker
==> PackMiddlewareTarget
==> PushMiddlewareTarget
==> PackRelayTarget
==> PushRelayTarget
==> "PackAndPush"
|> ignore

Target.runOrDefaultWithArguments "All"

Expand Down

0 comments on commit a87cd19

Please sign in to comment.