-
Notifications
You must be signed in to change notification settings - Fork 120
104 lines (96 loc) · 2.86 KB
/
publish_indexify_pypi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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/
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: |
# wait for the indexify-cli to be available
sleep 60
- uses: ./.github/workflows/publish_executor_containers.yaml
with:
indexify_version: ${{ needs.extract-version.outputs.version }}