Skip to content

Commit 7811156

Browse files
authored
PyPI whl build and upload to PyPI test server nightly job (#2317)
This script builds the python 3.10 and 3.11 wheels using python/tflite_micro/pypi_build.sh and then uploads to the test PyPI server with python/tflite_micro/pypi_upload.sh. It is scheduled to run at 1300 UTC each day (0600 or 0700 PST). The runs require approximately 11 minutes. This job can also be run manually by going to Actions > PyPI Build. There is an option to run only the whl build without upload for troubleshooting. It also should be relatively obvious how to add a release build option if the live server key was added to repo secrets and the script env block and another optional run block added with the -p <live server key> switch added to a copy of the upload script line. I have tested the build block, but can't test the upload section since I don't have access to the PYPI_API_KEY secret. BUG=request from rj
1 parent 0996efe commit 7811156

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/pypi_build.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# YAML schema for GitHub Actions:
2+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
3+
#
4+
# Helpful YAML parser to clarify YAML syntax:
5+
# https://yaml-online-parser.appspot.com/
6+
#
7+
8+
name: PyPI Build
9+
10+
on:
11+
schedule:
12+
# 1pm UTC is 6am or 7am PT depending on daylight savings.
13+
- cron: '0 13 * * *'
14+
15+
workflow_dispatch:
16+
inputs:
17+
upload-type:
18+
description: 'Upload type'
19+
required: true
20+
default: 'pypi'
21+
type: choice
22+
options:
23+
- 'pypi'
24+
- 'no upload'
25+
env:
26+
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
27+
28+
jobs:
29+
pypi-build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
with:
34+
token: ${{ secrets.TFLM_BOT_REPO_TOKEN }}
35+
- name: Build Wheel 3.10
36+
run: |
37+
python/tflite_micro/pypi_build.sh cp310
38+
- name: Build Wheel 3.11
39+
run: |
40+
python/tflite_micro/pypi_build.sh cp311
41+
- name: Check Directory Output
42+
run: |
43+
ls -l bazel-pypi-out
44+
- name: upload to pypi
45+
if: |
46+
github.event.inputs.upload-type == 'pypi' ||
47+
github.event_name == 'schedule'
48+
run: |
49+
python/tflite_micro/pypi_upload.sh \
50+
bazel-pypi-out/tflite_micro-*.whl

0 commit comments

Comments
 (0)