From d33fa0b87c21780a262abdeb9f08e44eefdf17cb Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Sat, 9 Mar 2024 01:52:33 +0100 Subject: [PATCH] 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). --- .github/workflows/CI.yml | 14 +++++--- scripts/{snap_bump.fsx => beta_bump.fsx} | 0 scripts/make.fsx | 41 ++++++++++++++++-------- 3 files changed, 36 insertions(+), 19 deletions(-) rename scripts/{snap_bump.fsx => beta_bump.fsx} (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9906bcd0d..033b95c43 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -490,7 +490,7 @@ jobs: if: github.event_name == 'pull_request' run: ./conventions/commitlint.sh --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose - nuget_pkg: + nuget_pkg_beta: needs: - conventions @@ -511,13 +511,17 @@ jobs: - name: ownership workaround run: git config --global --add safe.directory '*' - name: configure - run: ./configure.sh + run: ./configure.sh --native-segwit + - name: Bump version to beta (because segwit) + run: | + git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive + dotnet fsi ./scripts/beta_bump.fsx - name: pack&push run: make push snap_pkg: needs: - - nuget_pkg + - nuget_pkg_beta runs-on: ubuntu-22.04 steps: @@ -562,7 +566,7 @@ jobs: snap_pkg_beta: needs: - - nuget_pkg + - nuget_pkg_beta runs-on: ubuntu-22.04 steps: @@ -582,7 +586,7 @@ jobs: - name: Bump snap version run: | git submodule foreach git fetch --all && git submodule sync --recursive && git submodule update --init --recursive - dotnet fsi ./scripts/snap_bump.fsx + dotnet fsi ./scripts/beta_bump.fsx - name: Generate snap package run: | diff --git a/scripts/snap_bump.fsx b/scripts/beta_bump.fsx similarity index 100% rename from scripts/snap_bump.fsx rename to scripts/beta_bump.fsx diff --git a/scripts/make.fsx b/scripts/make.fsx index b445d5c4b..0c9bb7db0 100644 --- a/scripts/make.fsx +++ b/scripts/make.fsx @@ -174,19 +174,7 @@ let PrintNugetVersion () = Console.Out.Flush() failwith "nuget process' output contained errors ^" -let BuildSolutionOrProject - (buildToolAndBuildArg: string*string) - (file: FileInfo) - (binaryConfig: BinaryConfig) - (maybeConstant: Option) - (extraOptions: string) - = -#if LEGACY_FRAMEWORK - NugetRestore file -#endif - - let buildTool,buildArg = buildToolAndBuildArg - +let GetBuildFlags (buildTool: string) (binaryConfig) (maybeConstant: Option) = let configOption = if buildTool.StartsWith "dotnet" then sprintf "--configuration %s" (binaryConfig.ToString()) @@ -235,6 +223,24 @@ let BuildSolutionOrProject sprintf "%s -property:DefineConstants=\\\"%s\\\"" configOption (String.Join(semiColon, defineConstants)) else configOption + + configOptions + +let BuildSolutionOrProject + (buildToolAndBuildArg: string*string) + (file: FileInfo) + (binaryConfig: BinaryConfig) + (maybeConstant: Option) + (extraOptions: string) + = +#if LEGACY_FRAMEWORK + NugetRestore file +#endif + + let buildTool,buildArg = buildToolAndBuildArg + + let configOptions = GetBuildFlags buildTool binaryConfig maybeConstant + let buildArgs = sprintf "%s %s %s %s" buildArg file.FullName @@ -687,10 +693,17 @@ match maybeTarget with let backendDir = GetPathToBackend() let backendProj = Path.Combine(backendDir.FullName, BACKEND_LIB + ".fsproj") + let binaryConfig = + if isTag then + BinaryConfig.Release + else + BinaryConfig.Debug + let buildFlags = GetBuildFlags "dotnet" binaryConfig None + let allBuildFlags = sprintf "%s -property:Version=%s" buildFlags nugetVersion Process.Execute( { Command = "dotnet" - Arguments = sprintf "pack -property:Version=%s %s" nugetVersion backendProj + Arguments = sprintf "pack %s %s" allBuildFlags backendProj }, Echo.All ).UnwrapDefault() |> ignore