Skip to content

Commit 63c067d

Browse files
committed
Implemented launch profiles in the Build project
1 parent c79822a commit 63c067d

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
run: dotnet tool restore
3333

3434
- name: Build and run integration tests
35-
run: dotnet run --project build/Build.fsproj
35+
run: dotnet run --project build/Build.fsproj --launch-profile BuildAndTest

build/Program.fs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ let pack id =
238238
{
239239
p with
240240
Common = { p.Common with Version = Some release.NugetVersion }
241+
NoLogo = true
241242
OutputPath = Some packageDir
243+
MSBuildParams = { p.MSBuildParams with Properties = [("IsNuget", "true")] }
242244
}
243245
.WithCommon
244246
DotNetCli.setVersion)
@@ -250,7 +252,7 @@ type PushSource =
250252
let push id =
251253
let packageName = getPackageName id
252254
let packageDir = getPackageDir packageName
253-
let projectPath = getProjectPath packageName
255+
let packageFile = packageName + ".nupkg"
254256

255257
let source =
256258
#if NuGet
@@ -264,17 +266,17 @@ let push id =
264266
| GitHub -> "GITHUB_TOKEN", Some "github"
265267
| NuGet -> "NUGET_SECRET", None
266268

267-
projectPath
269+
packageFile
268270
|> DotNet.nugetPush (fun p ->
269271
{
270272
p with
271273
Common = { p.Common with WorkingDirectory = packageDir }
272-
SkipDuplicate = true
273274
PushParams = {
274275
p.PushParams
275276
with
276-
ApiKey = Some (Environment.environVar apiKeyVariableName)
277+
ApiKey = Some (Environment.GetEnvironmentVariable apiKeyVariableName)
277278
Source = source
279+
SkipDuplicate = true
278280
}
279281
}
280282
.WithCommon DotNetCli.setVersion)
@@ -304,7 +306,7 @@ Target.create "PackRelay" <| fun _ -> pack "Server.Relay"
304306
// Run all targets by default. Invoke 'build --target <Target>' to override
305307

306308
Target.create "All" ignore
307-
Target.create "PackAll" ignore
309+
Target.create "PackAndPush" ignore
308310

309311
"Clean"
310312
==> "Restore"
@@ -323,11 +325,16 @@ Target.create "PackAll" ignore
323325
|> ignore
324326

325327
"PackShared"
328+
==> "PublishShared"
326329
==> "PackClient"
330+
==> "PublishClient"
327331
==> "PackServer"
332+
==> "PublishServer"
328333
==> "PackMiddleware"
334+
==> "PublishMiddleware"
329335
==> "PackRelay"
330-
==> "PackAll"
336+
==> "PublishRelay"
337+
==> "Publish"
331338
|> ignore
332339

333340
Target.runOrDefaultWithArguments "All"
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"profiles": {
3-
"Build": {
4-
"commandName": "Project"//,
5-
//"commandLineArgs": "--target Clean"
3+
"BuildAndTest": {
4+
"commandName": "Project"
5+
},
6+
"PackAndPush": {
7+
"commandName": "Project",
8+
"commandLineArgs": "--target PackAndPush"
9+
},
10+
"GenerateDocs": {
11+
"commandName": "Project",
12+
"commandLineArgs": "--target GenerateDocs"
613
}
714
}
815
}

0 commit comments

Comments
 (0)