From bde7fe4192e175ab5ea19d56bffb0a9f3d6649bf Mon Sep 17 00:00:00 2001 From: Tania Allard Date: Thu, 19 Sep 2024 20:30:20 +0100 Subject: [PATCH] BUG - patch release workflow (#885) --- .github/workflows/release.yaml | 6 ++---- conda-store-server/hatch_build.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 955ca8f28..d5cc5db47 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -51,9 +51,9 @@ jobs: release-test-pypi: name: "Publish in-dev to test.pypi.org" environment: release-test-pypi - if: github.repository_owner == 'conda-incubator' && github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest needs: build-package + if: github.repository_owner == 'conda-incubator' && github.event_name == 'push' && github.ref == 'refs/heads/main' permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing strategy: @@ -69,7 +69,7 @@ jobs: name: Packages-${{ matrix.directory }} path: dist - - run: tar xf dist/*.tar.gz --strip-components=1 + - run: ls -lR dist/ - name: "Upload package to Test PyPI" uses: pypa/gh-action-pypi-publish@release/v1 @@ -103,8 +103,6 @@ jobs: name: Packages-${{ matrix.directory }} path: dist - - run: tar xf dist/*.tar.gz --strip-components=1 - - name: "Upload to PyPI 🚀" uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/conda-store-server/hatch_build.py b/conda-store-server/hatch_build.py index 248ab1e83..c4741fe6e 100644 --- a/conda-store-server/hatch_build.py +++ b/conda-store-server/hatch_build.py @@ -21,7 +21,7 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface -CONDA_STORE_UI_VERSION = "2024.9.1" +CONDA_STORE_UI_VERSION = "2024.3.1" CONDA_STORE_UI_URL = f"https://registry.npmjs.org/@conda-store/conda-store-ui/-/conda-store-ui-{CONDA_STORE_UI_VERSION}.tgz" UI_FILES_EXTENSIONS = ["*.js", "*.css", "*.js.map", "*.css.map", "*.html"] @@ -67,7 +67,10 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None: if Path(os.getenv("LOCAL_UI")).exists(): local_ui_path = os.getenv("LOCAL_UI") source_directory = Path(local_ui_path) / "dist" - self.copy_ui_files(source_directory) + if source_directory.exists(): + self.copy_ui_files(source_directory) + else: + print(f"Directory does not exist: {source_directory}") else: raise FileNotFoundError( @@ -121,10 +124,10 @@ def copy_ui_files(self, source_directory: str) -> None: for extension in UI_FILES_EXTENSIONS: for file_path in source_directory.glob(extension): target_path = server_build_static_assets / file_path.name - # in case the file already exists, remove it - if target_path.exists(): - target_path.unlink() - shutil.copy(file_path, target_path) + # in case the file already exists, remove it + if target_path.exists(): + target_path.unlink() + shutil.copy(file_path, target_path) print( f"Copied files: {[p.name for p in server_build_static_assets.glob('*')]}"