ci: [refactor] Move print_version step into ci-windows-cross.py helper

This commit is contained in:
MarcoFalke
2026-02-10 10:46:47 +01:00
parent 64294c8909
commit fa674d55df
2 changed files with 41 additions and 1 deletions

40
.github/ci-windows-cross.py vendored Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env python3
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
import argparse
import shlex
import subprocess
import sys
from pathlib import Path
def run(cmd, **kwargs):
print("+ " + shlex.join(cmd), flush=True)
kwargs.setdefault("check", True)
try:
return subprocess.run(cmd, **kwargs)
except Exception as e:
sys.exit(str(e))
def print_version():
bitcoind = Path.cwd() / "bin" / "bitcoind.exe"
run([str(bitcoind), "-version"])
def main():
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
steps = [
"print_version",
]
parser.add_argument("step", choices=steps, help="CI step to perform.")
args = parser.parse_args()
if args.step == "print_version":
print_version()
if __name__ == "__main__":
main()

View File

@@ -407,7 +407,7 @@ jobs:
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
- name: Run bitcoind.exe
run: ./bin/bitcoind.exe -version
run: py -3 .github/ci-windows-cross.py print_version
- *SET_UP_VS