diff --git a/.ci/pull_fluent_image.py b/.ci/pull_fluent_image.py deleted file mode 100644 index 3fc1d1fa379c..000000000000 --- a/.ci/pull_fluent_image.py +++ /dev/null @@ -1,31 +0,0 @@ -import os - -import docker - -_IMAGE_TAG = os.getenv("FLUENT_IMAGE_TAG", "latest") -_IMAGE_NAME = f"ghcr.io/pyansys/pyfluent:{_IMAGE_TAG}" - - -def _is_newer_version_available(client: docker.DockerClient): - try: - local_image = client.images.get(name=_IMAGE_NAME) - except docker.errors.ImageNotFound: - return True - - local_image_digest = local_image.attrs.get("RepoDigests")[0].split("@")[-1] - remote_image_digest = client.images.get_registry_data(name=_IMAGE_NAME).id - return remote_image_digest != local_image_digest - - -def _pull_image(client: docker.DockerClient): - if _is_newer_version_available(client=client): - try: - client.images.remove(image=_IMAGE_NAME, force=True) - except docker.errors.ImageNotFound: - pass - client.images.pull(repository=_IMAGE_NAME) - - -if __name__ == "__main__": - client = docker.from_env() - _pull_image(client=client) diff --git a/.ci/pull_fluent_image.sh b/.ci/pull_fluent_image.sh new file mode 100644 index 000000000000..1626f97e744e --- /dev/null +++ b/.ci/pull_fluent_image.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Image name +_IMAGE_NAME="ghcr.io/pyansys/pyfluent:${FLUENT_IMAGE_TAG:-latest}" + +# Pull fluent image based on tag +docker pull $_IMAGE_NAME + +# Remove all dangling images +docker image prune -f \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2929a09f4350..74017a63ba8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -354,7 +354,7 @@ jobs: python -m twine upload --skip-existing ./**/*.tar.gz env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + TWINE_PASSWORD: ${{ secrets.ANSYS_FLUENT_CORE_PYPI_TOKEN }} - name: Release uses: softprops/action-gh-release@v1 diff --git a/Makefile b/Makefile index 11dbe435ef33..5c0de42c6869 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ version-info: docker-pull: @pip install docker - @python .ci/pull_fluent_image.py + @bash .ci/pull_fluent_image.sh test-import: @python -c "import ansys.fluent.core as pyfluent"