Skip to content

Commit d33fa0b

Browse files
committed
CI,make.fsx: use --native-segwit for dotnet pack
We use beta version because we use NativeSegwit (0.9 instead of 0.7, like the beta snap).
1 parent 7eba876 commit d33fa0b

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

.github/workflows/CI.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ jobs:
490490
if: github.event_name == 'pull_request'
491491
run: ./conventions/commitlint.sh --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
492492

493-
nuget_pkg:
493+
nuget_pkg_beta:
494494
needs:
495495
- conventions
496496

@@ -511,13 +511,17 @@ jobs:
511511
- name: ownership workaround
512512
run: git config --global --add safe.directory '*'
513513
- name: configure
514-
run: ./configure.sh
514+
run: ./configure.sh --native-segwit
515+
- name: Bump version to beta (because segwit)
516+
run: |
517+
git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive
518+
dotnet fsi ./scripts/beta_bump.fsx
515519
- name: pack&push
516520
run: make push
517521

518522
snap_pkg:
519523
needs:
520-
- nuget_pkg
524+
- nuget_pkg_beta
521525

522526
runs-on: ubuntu-22.04
523527
steps:
@@ -562,7 +566,7 @@ jobs:
562566
snap_pkg_beta:
563567

564568
needs:
565-
- nuget_pkg
569+
- nuget_pkg_beta
566570

567571
runs-on: ubuntu-22.04
568572
steps:
@@ -582,7 +586,7 @@ jobs:
582586
- name: Bump snap version
583587
run: |
584588
git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive
585-
dotnet fsi ./scripts/snap_bump.fsx
589+
dotnet fsi ./scripts/beta_bump.fsx
586590
587591
- name: Generate snap package
588592
run: |
File renamed without changes.

scripts/make.fsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,7 @@ let PrintNugetVersion () =
174174
Console.Out.Flush()
175175
failwith "nuget process' output contained errors ^"
176176

177-
let BuildSolutionOrProject
178-
(buildToolAndBuildArg: string*string)
179-
(file: FileInfo)
180-
(binaryConfig: BinaryConfig)
181-
(maybeConstant: Option<string>)
182-
(extraOptions: string)
183-
=
184-
#if LEGACY_FRAMEWORK
185-
NugetRestore file
186-
#endif
187-
188-
let buildTool,buildArg = buildToolAndBuildArg
189-
177+
let GetBuildFlags (buildTool: string) (binaryConfig) (maybeConstant: Option<string>) =
190178
let configOption =
191179
if buildTool.StartsWith "dotnet" then
192180
sprintf "--configuration %s" (binaryConfig.ToString())
@@ -235,6 +223,24 @@ let BuildSolutionOrProject
235223
sprintf "%s -property:DefineConstants=\\\"%s\\\"" configOption (String.Join(semiColon, defineConstants))
236224
else
237225
configOption
226+
227+
configOptions
228+
229+
let BuildSolutionOrProject
230+
(buildToolAndBuildArg: string*string)
231+
(file: FileInfo)
232+
(binaryConfig: BinaryConfig)
233+
(maybeConstant: Option<string>)
234+
(extraOptions: string)
235+
=
236+
#if LEGACY_FRAMEWORK
237+
NugetRestore file
238+
#endif
239+
240+
let buildTool,buildArg = buildToolAndBuildArg
241+
242+
let configOptions = GetBuildFlags buildTool binaryConfig maybeConstant
243+
238244
let buildArgs = sprintf "%s %s %s %s"
239245
buildArg
240246
file.FullName
@@ -687,10 +693,17 @@ match maybeTarget with
687693
let backendDir = GetPathToBackend()
688694
let backendProj = Path.Combine(backendDir.FullName, BACKEND_LIB + ".fsproj")
689695

696+
let binaryConfig =
697+
if isTag then
698+
BinaryConfig.Release
699+
else
700+
BinaryConfig.Debug
701+
let buildFlags = GetBuildFlags "dotnet" binaryConfig None
702+
let allBuildFlags = sprintf "%s -property:Version=%s" buildFlags nugetVersion
690703
Process.Execute(
691704
{
692705
Command = "dotnet"
693-
Arguments = sprintf "pack -property:Version=%s %s" nugetVersion backendProj
706+
Arguments = sprintf "pack %s %s" allBuildFlags backendProj
694707
},
695708
Echo.All
696709
).UnwrapDefault() |> ignore<string>

0 commit comments

Comments
 (0)