Publish Indexify to PyPI #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Indexify to PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
release_message: | |
type: string | |
description: Release message | |
required: true | |
prerelease: | |
type: boolean | |
description: Is this a pre-release version? | |
required: false | |
default: false | |
permissions: | |
contents: write | |
actions: write | |
packages: write | |
defaults: | |
run: | |
working-directory: ./python-sdk | |
jobs: | |
extract-version: | |
name: Extract Version Number | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version_extraction.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install toml | |
run: pip install toml | |
- id: version_extraction | |
run: echo "version=$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["poetry"]["version"])')" >> $GITHUB_OUTPUT | |
# create-release: | |
# name: Create GitHub Release | |
# runs-on: ubuntu-latest | |
# needs: | |
# - extract-version | |
# steps: | |
# - name: Create GitHub Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# with: | |
# tag_name: "v${{ needs.extract-version.outputs.version }}" | |
# prerelease: ${{ github.event.inputs.prerelease }} | |
# body: ${{ github.event.inputs.release_message }} | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-indexify-to-pypi: | |
name: Publish Indexify Python Client | |
runs-on: ubuntu-latest | |
# needs: | |
# - create-release | |
environment: | |
name: pypi | |
url: https://pypi.org/p/indexify | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Build python-sdk | |
run: make build | |
- name: Publish Indexify Client to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: python-sdk/dist/ | |
publish-containers: | |
name: Publish Containers | |
needs: | |
- extract-version | |
- publish-indexify-to-pypi | |
uses: ./.github/workflows/publish_executor_containers.yaml | |
with: | |
indexify_version: ${{ needs.extract-version.outputs.version }} | |
secrets: inherit |