-
Notifications
You must be signed in to change notification settings - Fork 62
97 lines (94 loc) · 2.73 KB
/
Copy pathpublish.yml
File metadata and controls
97 lines (94 loc) · 2.73 KB
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
name: Publish
on:
release:
types: [published]
pull_request:
paths:
- '.github/workflows/publish.yml'
- 'maint_tools/build_default_image.py'
jobs:
pypi:
name: PyPI package
runs-on: ubuntu-latest
strategy:
matrix:
workdir:
- "."
- "plugins/ray"
- "plugins/spark"
- "plugins/openai"
- "plugins/dask"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install uv
uses: astral-sh/setup-uv@v6
id: setup-uv
- name: Install dependencies
working-directory: ${{ matrix.workdir }}
run: |
uv venv
uv pip install build twine setuptools wheel
- name: Build and publish
working-directory: ${{ matrix.workdir }}
run: |
uv run --prerelease allow python -m build --wheel --installer uv
- name: Publish
if: ${{ github.event_name == 'release' }}
working-directory: ${{ matrix.workdir }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
uv run python -m twine upload --verbose dist/*
build-and-push-docker-images:
needs: pypi
name: Flyte image for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/flyteorg
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Fetch the code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: ./.github/actions/setup-python-env
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
uv venv
uv pip install build twine setuptools wheel
uv pip freeze
- name: Build wheel
run: |
make dist
- name: Build and push the images
env:
FLYTE_DOCKER_BUILDER_CACHE_FROM: "type=gha"
FLYTE_DOCKER_BUILDER_CACHE_TO: "type=gha,mode=max"
run: |
uv run python maint_tools/build_default_image.py