From 76dbd78b0919d6f7e6eedd790bcc2efbda697fe4 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Sat, 20 Apr 2024 12:47:11 -0400 Subject: [PATCH] debug --- .github/workflows/release_dispatch.yml | 2 +- distribution/build_dist.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release_dispatch.yml b/.github/workflows/release_dispatch.yml index 7e96783c37e..3b55e2b8ca4 100644 --- a/.github/workflows/release_dispatch.yml +++ b/.github/workflows/release_dispatch.yml @@ -128,7 +128,7 @@ jobs: echo "version=$ver" >> $GITHUB_OUTPUT make_dist: name: Make distribution - uses: MODFLOW-USGS/modflow6/.github/workflows/release.yml@develop + uses: wpbonelli/modflow6/.github/workflows/release.yml@fix-release-ci needs: set_options with: # If the workflow is manually triggered, the maintainer must manually set approve=true to approve a release. diff --git a/distribution/build_dist.py b/distribution/build_dist.py index 12ff7fcfe86..79627da8070 100644 --- a/distribution/build_dist.py +++ b/distribution/build_dist.py @@ -6,7 +6,7 @@ from os import PathLike, environ from pathlib import Path from pprint import pprint -from shutil import copy, copyfile, copytree, ignore_patterns +from shutil import copy, copyfile, copytree, ignore_patterns, rmtree from typing import List, Optional import pytest @@ -114,19 +114,18 @@ def setup_examples( models: Optional[List[str]] = None, ): examples_path = Path(examples_path).expanduser().absolute() - - # download example models zip asset latest = get_release("MODFLOW-USGS/modflow6-examples", "latest") assets = latest["assets"] asset = next( iter([a for a in assets if a["name"] == "modflow6-examples.zip"]), None ) + # download example models zip asset download_and_unzip(asset["browser_download_url"], examples_path, verbose=True) # filter examples for models selected for release for p in examples_path.glob("*"): if not any(m in p.stem for m in models): - p.unlink() + rmtree(p) # list folders with mfsim.nam (recursively) # and add run.sh/bat script to each folder