From 4fbd7c43efa1c8c13bd11a45985a2f652690206e Mon Sep 17 00:00:00 2001 From: geisserml Date: Wed, 22 Nov 2023 23:17:45 +0100 Subject: [PATCH] continue --- .github/workflows/conda.yaml | 6 +++++- setupsrc/pypdfium2_setup/autorelease_conda_raw.py | 4 +++- setupsrc/pypdfium2_setup/craft_packages.py | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conda.yaml b/.github/workflows/conda.yaml index 5c0ef5fbd..9d7050f71 100644 --- a/.github/workflows/conda.yaml +++ b/.github/workflows/conda.yaml @@ -30,7 +30,7 @@ defaults: run: shell: bash -el {0} -# TODO it would be nice to also support building both packages in one run and testing the helpers package with the newly-built raw package, but this may be failry complicated +# TODO it would be nice to also support building both packages in one run and testing the helpers package with the newly-built raw package, but this may be fairly complicated jobs: @@ -61,6 +61,10 @@ jobs: git config --global user.name "geisserml" python -m pip install -U -r req/setup.txt + # this is used to automatically manage build number for rebuilds of the raw package + - name: Autorelease (raw package) + run: python setupsrc/pypdfium2_setup/autorelease_conda_raw.py --pdfium-ver ${{ inputs.raw_version }} + - name: Build package run: ./run craft conda_${{ inputs.package }} diff --git a/setupsrc/pypdfium2_setup/autorelease_conda_raw.py b/setupsrc/pypdfium2_setup/autorelease_conda_raw.py index 9f40f0c46..55ca41628 100644 --- a/setupsrc/pypdfium2_setup/autorelease_conda_raw.py +++ b/setupsrc/pypdfium2_setup/autorelease_conda_raw.py @@ -15,8 +15,10 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument("--pdfium-ver", type=int, default=None) args = parser.parse_args() - if not args.pdfium_ver: + if not args.pdfium_ver or args.pdfium_ver == "latest": args.pdfium_ver = PdfiumVer.get_latest() + else: + args.pdfium_ver = int(args.pdfium_ver) # parse existing releases to automatically handle arbitrary version builds search = run_cmd(["conda", "search", "pypdfium2_raw", "--override-channels", "-c", "pypdfium2-team"], cwd=None, capture=True) diff --git a/setupsrc/pypdfium2_setup/craft_packages.py b/setupsrc/pypdfium2_setup/craft_packages.py index 52a75cb97..04dc5c2ee 100644 --- a/setupsrc/pypdfium2_setup/craft_packages.py +++ b/setupsrc/pypdfium2_setup/craft_packages.py @@ -53,8 +53,10 @@ def parse_args(): ) args = root_parser.parse_args() - if not args.pdfium_ver: + if not args.pdfium_ver or args.pdfium_ver == "latest": args.pdfium_ver = PdfiumVer.get_latest() + else: + args.pdfium_ver = int(args.pdfium_ver) if args.parser == P_CONDA_BUNDLE: if args.platforms and args.platforms[0] == "all": args.platforms = list(CondaNames.keys())