Publish Indexify to PyPI #23
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: python3 -m pip install poetry --user | |
- name: Build Packages | |
run: python3 -m poetry build | |
- name: Publish Indexify Client to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: python-sdk/dist/ | |
build-and-push-docker-images: | |
name: Build and Push Docker Executor | |
runs-on: ubuntu-latest | |
needs: | |
- extract-version | |
- publish-indexify-to-pypi | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- run: | | |
sleep 15 | |
pip install indexify -U | |
indexify-cli build-default-image | |
docker push tensorlake/indexify-executor-default:3.10 | |
docker push tensorlake/indexify-executor-default:3.11 |