name: Upload Python Package permissions: contents: read id-token: write on: workflow_call: workflow_dispatch: inputs: tag: description: "Tag to release (WARNING: Only use for emergency fixes, not for regular releases)" required: false type: string defaults: run: shell: bash working-directory: ./python jobs: # Note this code is currently duplicated in ci-post-release, due to PyPi # limitations with reusable workflows, see comment there. # If you make changes here please also update ci-post-release.yml accordingly. deploy: runs-on: ubuntu-latest-amd64 environment: name: release url: https://pypi.org/p/feldera steps: - uses: actions/checkout@v6 with: ref: ${{ inputs.tag || github.ref }} - name: Install uv uses: astral-sh/setup-uv@v2 with: version: "0.4.15" enable-cache: true cache-dependency-glob: "python/uv.lock" - name: "Set up Python" uses: actions/setup-python@v5 with: python-version-file: "python/pyproject.toml" - name: Install the project run: uv sync --all-extras --dev - name: Build package run: | uv build - name: Publish package if: ${{ vars.RELEASE_DRY_RUN == 'false' }} uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e with: packages-dir: ./python/dist - name: Minimize uv cache run: uv cache prune --ci