Skip to content

Commit

Permalink
CI,make.fsx: use --native-segwit for dotnet pack
Browse files Browse the repository at this point in the history
We use beta version because we use NativeSegwit (0.9 instead of
0.7, like the beta snap).
  • Loading branch information
knocte committed Mar 9, 2024
1 parent 7eba876 commit d33fa0b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -562,7 +566,7 @@ jobs:
snap_pkg_beta:

needs:
- nuget_pkg
- nuget_pkg_beta

runs-on: ubuntu-22.04
steps:
Expand All @@ -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: |
Expand Down
File renamed without changes.
41 changes: 27 additions & 14 deletions scripts/make.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>)
(extraOptions: string)
=
#if LEGACY_FRAMEWORK
NugetRestore file
#endif

let buildTool,buildArg = buildToolAndBuildArg

let GetBuildFlags (buildTool: string) (binaryConfig) (maybeConstant: Option<string>) =
let configOption =
if buildTool.StartsWith "dotnet" then
sprintf "--configuration %s" (binaryConfig.ToString())
Expand Down Expand Up @@ -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<string>)
(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
Expand Down Expand Up @@ -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<string>
Expand Down

0 comments on commit d33fa0b

Please sign in to comment.