From 6b18962cae571978ff7ffc40cf9e7c15d7706d5d Mon Sep 17 00:00:00 2001 From: jpwithers Date: Wed, 15 Nov 2023 03:45:07 -0800 Subject: [PATCH 1/5] pypi wheel build and test upload --- .github/workflows/pypi_build.yml | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/pypi_build.yml diff --git a/.github/workflows/pypi_build.yml b/.github/workflows/pypi_build.yml new file mode 100644 index 00000000000..a13202afe96 --- /dev/null +++ b/.github/workflows/pypi_build.yml @@ -0,0 +1,56 @@ +# YAML schema for GitHub Actions: +# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions +# +# Helpful YAML parser to clarify YAML syntax: +# https://yaml-online-parser.appspot.com/ +# + +name: PyPI Build + +on: + schedule: + # 1pm UTC is 6am or 7am PT depending on daylight savings. + - cron: '0 13 * * *' + + workflow_dispatch: + inputs: + upload-type: + description: 'Upload type' + required: true + default: 'test-pypi' + type: choice + options: + - 'test-pypi' + - 'release' + - 'no upload' +env: + TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} + +jobs: + test-pypi-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.TFLM_BOT_REPO_TOKEN }} + - name: Build Wheel 3.10 + run: | + python/tflite_micro/pypi_build.sh cp310 + - name: Build Wheel 3.11 + run: | + python/tflite_micro/pypi_build.sh cp311 + - name: Check Directory Output + run: | + ls -l bazel-pypi-out + - name: upload to test pypi + if: | + github.event.inputs.upload-type == 'test-pypi' || + github.event_name == 'schedule' + run: | + python/tflite_micro/pypi_upload.sh \ + --test-pypi bazel-pypi-out/tflite_micro-*.whl + - name: upload to pypi release + if: github.event.inputs.upload-type == 'release' + run: | + python/tflite_micro/pypi_upload.sh \ + bazel-pypi-out/tflite_micro-*.whl \ No newline at end of file From 78a5534e02768f42742ebebb2b453ddf7b08fc4f Mon Sep 17 00:00:00 2001 From: jpwithers Date: Wed, 15 Nov 2023 04:18:59 -0800 Subject: [PATCH 2/5] nightly script to build whls and push to pypi test --- .github/workflows/pypi_build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/pypi_build.yml b/.github/workflows/pypi_build.yml index a13202afe96..b52244f6671 100644 --- a/.github/workflows/pypi_build.yml +++ b/.github/workflows/pypi_build.yml @@ -21,7 +21,6 @@ on: type: choice options: - 'test-pypi' - - 'release' - 'no upload' env: TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} @@ -48,9 +47,4 @@ jobs: github.event_name == 'schedule' run: | python/tflite_micro/pypi_upload.sh \ - --test-pypi bazel-pypi-out/tflite_micro-*.whl - - name: upload to pypi release - if: github.event.inputs.upload-type == 'release' - run: | - python/tflite_micro/pypi_upload.sh \ - bazel-pypi-out/tflite_micro-*.whl \ No newline at end of file + --test-pypi bazel-pypi-out/tflite_micro-*.whl \ No newline at end of file From 7507d4fd795b4c633bad4d8a6b0f3ec1ff7bed20 Mon Sep 17 00:00:00 2001 From: jpwithers Date: Wed, 15 Nov 2023 12:40:14 -0800 Subject: [PATCH 3/5] changed to production pypi from test pypi --- .github/workflows/pypi_build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi_build.yml b/.github/workflows/pypi_build.yml index b52244f6671..e18aeb45b96 100644 --- a/.github/workflows/pypi_build.yml +++ b/.github/workflows/pypi_build.yml @@ -17,10 +17,10 @@ on: upload-type: description: 'Upload type' required: true - default: 'test-pypi' + default: 'pypi' type: choice options: - - 'test-pypi' + - 'pypi' - 'no upload' env: TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} @@ -41,10 +41,10 @@ jobs: - name: Check Directory Output run: | ls -l bazel-pypi-out - - name: upload to test pypi + - name: upload to pypi if: | github.event.inputs.upload-type == 'test-pypi' || github.event_name == 'schedule' run: | python/tflite_micro/pypi_upload.sh \ - --test-pypi bazel-pypi-out/tflite_micro-*.whl \ No newline at end of file + bazel-pypi-out/tflite_micro-*.whl \ No newline at end of file From f095dc3d6639c2f3b7f80125068b4f07c0eaaec6 Mon Sep 17 00:00:00 2001 From: jpwithers Date: Wed, 15 Nov 2023 12:43:16 -0800 Subject: [PATCH 4/5] fixed missed conditional --- .github/workflows/pypi_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_build.yml b/.github/workflows/pypi_build.yml index e18aeb45b96..46979747e96 100644 --- a/.github/workflows/pypi_build.yml +++ b/.github/workflows/pypi_build.yml @@ -43,7 +43,7 @@ jobs: ls -l bazel-pypi-out - name: upload to pypi if: | - github.event.inputs.upload-type == 'test-pypi' || + github.event.inputs.upload-type == 'pypi' || github.event_name == 'schedule' run: | python/tflite_micro/pypi_upload.sh \ From 8f6166aa03f7f8c3f972da4311eb32bf30cc0527 Mon Sep 17 00:00:00 2001 From: jpwithers Date: Wed, 15 Nov 2023 12:44:59 -0800 Subject: [PATCH 5/5] changed job label --- .github/workflows/pypi_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi_build.yml b/.github/workflows/pypi_build.yml index 46979747e96..58052fefeab 100644 --- a/.github/workflows/pypi_build.yml +++ b/.github/workflows/pypi_build.yml @@ -26,7 +26,7 @@ env: TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} jobs: - test-pypi-build: + pypi-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2