From 417d6273ec5e1901c42e3de50f446265fcfac08d Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Thu, 14 Dec 2023 17:04:59 -0500 Subject: [PATCH 1/2] use GitHub vars when releasing container images --- .github/workflows/publish-docker-images.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-docker-images.yml b/.github/workflows/publish-docker-images.yml index 80f671e8b..4471dcf07 100644 --- a/.github/workflows/publish-docker-images.yml +++ b/.github/workflows/publish-docker-images.yml @@ -72,11 +72,12 @@ jobs: - name: Set Up Container Image Tags for zrok CLI Container env: - RELEASE_REPO: openziti/zrok - ZROK_VERSION: ${{ steps.semver.outputs.zrok_semver }} + ZROK_CONTAINER_IMAGE_REPO: ${{ vars.ZROK_CONTAINER_IMAGE_REPO || 'openziti/zrok' }} + ZROK_CONTAINER_IMAGE_TAG: ${{ steps.semver.outputs.zrok_semver }} id: tagprep_cli run: | - echo DOCKER_TAGS="${RELEASE_REPO}:${ZROK_VERSION},${RELEASE_REPO}:latest" | tee -a $GITHUB_OUTPUT + echo DOCKER_TAGS="${ZROK_CONTAINER_IMAGE_REPO}:${ZROK_CONTAINER_IMAGE_TAG},${ZROK_CONTAINER_IMAGE_REPO}:latest" \ + | tee -a $GITHUB_OUTPUT # this is the CLI image with the Linux binary for each # arch that was downloaded in ./dist/ From 96e5e145d03d485973d4e8b02ad044c4f0d8bd1a Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Thu, 14 Dec 2023 18:03:58 -0500 Subject: [PATCH 2/2] build Py wheel with alternate name in testing forks --- .flake8 | 2 ++ .github/workflows/build-wheels.yml | 1 + sdk/python/sdk/zrok/setup.py | 18 +++++++++++------- 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..6deafc261 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120 diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index bd852b429..1d5009cc5 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -35,6 +35,7 @@ jobs: - name: Build distro env: ZROK_VERSION: ${{ github.event.release.tag_name }} + ZROK_PY_NAME: ${{ vars.ZROK_PY_NAME || null }} run: | python setup.py sdist diff --git a/sdk/python/sdk/zrok/setup.py b/sdk/python/sdk/zrok/setup.py index 562368dfd..3e87bf05c 100644 --- a/sdk/python/sdk/zrok/setup.py +++ b/sdk/python/sdk/zrok/setup.py @@ -1,16 +1,20 @@ -from setuptools import setup, find_packages # noqa: H301 import os -NAME = "zrok_sdk" -VERSION = "0.4.0.dev" -try: - VERSION = os.environ['ZROK_VERSION'] -except KeyError: - pass +from setuptools import find_packages, setup # noqa: H301 + +# optionally upload to TestPyPi with alternative name in testing repo +NAME = os.getenv('ZROK_PY_NAME', "zrok_sdk") +# inherit zrok version from environment or default to dev version +VERSION = os.getenv('ZROK_VERSION', "0.4.0.dev") + # To install the library, run the following # # python setup.py install # +# or +# +# pip install --editable . +# # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools