diff --git a/.github/workflows/python-poetry-pypi-with-data.yml b/.github/workflows/python-poetry-pypi-with-data.yml deleted file mode 100644 index f539573e2..000000000 --- a/.github/workflows/python-poetry-pypi-with-data.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: deploy - -on: - workflow_call: - inputs: - python-version: - type: string - default: ${{ vars.PYTHON_VERSION_WORKFLOWS }} - required: false - description: > - Python version used to test and build the package - data-version: - type: string - required: true - description: > - Data version used for caching - data-download: - type: string - required: true - description: > - Data download command - poetry-extras: - type: string - required: false - description: > - Extras to be installed, in poetry format (e.g. "-E extra1 extra2") - -jobs: - publish: - name: 📦 PyPI (🐍 ${{ inputs.python-version }}) - runs-on: ubuntu-latest - permissions: - id-token: write - - steps: - - uses: actions/checkout@v4 - with: - # tags needed for dynamic versioning - fetch-depth: 0 - - name: Set up Python ${{ inputs.python-version }} 🐍 - id: setup-python - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - - name: Install and configure Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-path: ~/.virtualenvs - installer-parallel: true - - name: Cache Poetry virtualenv - uses: actions/cache@v4 - id: cache - with: - path: ~/.virtualenvs - key: ${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }} - - name: Install version management tool - run: | - # same poetry env - PIP="$(head -n1 $(which poetry) | cut -c 3-) -m pip" - ${PIP} install poetry-dynamic-versioning - - name: Install dependencies - run: poetry install --no-interaction --no-root --with test ${{ inputs.poetry-extras }} - if: steps.cache.outputs.cache-hit != 'true' - - name: Install project - # it is required to repeat extras, otherwise they will be removed from - # the environment - run: poetry install --no-interaction ${{ inputs.poetry-extras }} - - name: Install task runner - run: pip install poethepoet - - name: Get test data - id: cache-test-data - uses: actions/cache@v4 - with: - path: test-data - key: test-data-${{inputs.data-version}} - - name: Download test data - if: steps.cache-test-data.outputs.cache-hit != 'true' - run: | - ${{ inputs.data-download }} - - name: Test - run: | - # run tests just before deployment - poe test - - name: Package the distribution - run: | - # package the pure python wheel - poetry build - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release-ekors.yml b/.github/workflows/release-ekors.yml index f6ee33f96..ae6c97609 100644 --- a/.github/workflows/release-ekors.yml +++ b/.github/workflows/release-ekors.yml @@ -174,6 +174,8 @@ jobs: release: name: Release + environment: + name: pypi runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != '' needs: [linux, windows, macos, sdist] diff --git a/.github/workflows/release-pyapi.yml b/.github/workflows/release-pyapi.yml index ec568efdf..e5fae7cb1 100644 --- a/.github/workflows/release-pyapi.yml +++ b/.github/workflows/release-pyapi.yml @@ -180,6 +180,8 @@ jobs: release: name: Release + environment: + name: pypi runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != '' needs: [linux, windows, macos, sdist] diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index e16c3d7f3..16a9f1c1c 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -19,9 +19,64 @@ permissions: jobs: publish: + name: 📦 PyPI (🐍 ${{ vars.PYTHON_VERSION_WORKFLOWS }}) + environment: + name: pypi + runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') || github.event.inputs.tag != '' - uses: ./.github/workflows/python-poetry-pypi-with-data.yml - with: - poetry-extras: "-E mark -E box" - data-version: "v2" - data-download: "./tests/data/assets.sh" + + steps: + - uses: actions/checkout@v4 + with: + # tags needed for dynamic versioning + fetch-depth: 0 + - name: Set up Python ${{ vars.PYTHON_VERSION_WORKFLOWS }} 🐍 + id: setup-python + uses: actions/setup-python@v5 + with: + python-version: ${{ vars.PYTHON_VERSION_WORKFLOWS }} + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-path: ~/.virtualenvs + installer-parallel: true + - name: Cache Poetry virtualenv + uses: actions/cache@v4 + id: cache + with: + path: ~/.virtualenvs + key: ${{ runner.os }}-py-${{ steps.setup-python.outputs.python-version }}-poetry-${{ hashFiles('poetry.lock') }} + - name: Install version management tool + run: | + # same poetry env + PIP="$(head -n1 $(which poetry) | cut -c 3-) -m pip" + ${PIP} install poetry-dynamic-versioning + - name: Install dependencies + run: poetry install --no-interaction --no-root --with test -E mark -E box + if: steps.cache.outputs.cache-hit != 'true' + - name: Install project + # it is required to repeat extras, otherwise they will be removed from + # the environment + run: poetry install --no-interaction -E mark -E box + - name: Install task runner + run: pip install poethepoet + - name: Get test data + id: cache-test-data + uses: actions/cache@v4 + with: + path: test-data + key: test-data-v2 + - name: Download test data + if: steps.cache-test-data.outputs.cache-hit != 'true' + run: | + ./tests/data/assets.sh + - name: Test + run: | + # run tests just before deployment + poe test + - name: Package the distribution + run: | + # package the pure python wheel + poetry build + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1