Skip to content

Commit 432ca99

Browse files
committed
Add job to publish Python artifacts to PyPI on tag pushes
1 parent f1c0559 commit 432ca99

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

.github/workflows/build-and-test.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,110 @@ jobs:
701701
with:
702702
name: ${{ github.job }}-checkpoint.tar.xz
703703
path: ${{ github.workspace }}/artifacts/checkpoint.tar.xz
704+
twine-upload:
705+
name: "Upload to PyPI"
706+
runs-on: ubuntu-20.04
707+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
708+
needs: [build-python-Linux, build-python-macOS, build-python-Windows, build-python-LinuxArmv7, build-python-LinuxAarch64]
709+
steps:
710+
- uses: actions/setup-python@v2
711+
with:
712+
python-version: 3.8
713+
- name: Update pip and install twine
714+
run: |
715+
python -m pip install -U pip
716+
python -m pip install -U twine
717+
- uses: actions/download-artifact@v2
718+
with:
719+
name: stt-tf-3.6.8-macOS.whl
720+
- uses: actions/download-artifact@v2
721+
with:
722+
name: stt-tf-3.7.9-macOS.whl
723+
- uses: actions/download-artifact@v2
724+
with:
725+
name: stt-tf-3.8.9-macOS.whl
726+
- uses: actions/download-artifact@v2
727+
with:
728+
name: stt-tf-3.9.4-macOS.whl
729+
- uses: actions/download-artifact@v2
730+
with:
731+
name: stt-tflite-3.6.8-macOS.whl
732+
- uses: actions/download-artifact@v2
733+
with:
734+
name: stt-tflite-3.7.9-macOS.whl
735+
- uses: actions/download-artifact@v2
736+
with:
737+
name: stt-tflite-3.8.9-macOS.whl
738+
- uses: actions/download-artifact@v2
739+
with:
740+
name: stt-tflite-3.9.4-macOS.whl
741+
- uses: actions/download-artifact@v2
742+
with:
743+
name: stt-tf-3.6.8-Windows.whl
744+
- uses: actions/download-artifact@v2
745+
with:
746+
name: stt-tf-3.7.9-Windows.whl
747+
- uses: actions/download-artifact@v2
748+
with:
749+
name: stt-tf-3.8.8-Windows.whl
750+
- uses: actions/download-artifact@v2
751+
with:
752+
name: stt-tf-3.9.4-Windows.whl
753+
- uses: actions/download-artifact@v2
754+
with:
755+
name: stt-tflite-3.6.8-Windows.whl
756+
- uses: actions/download-artifact@v2
757+
with:
758+
name: stt-tflite-3.7.9-Windows.whl
759+
- uses: actions/download-artifact@v2
760+
with:
761+
name: stt-tflite-3.8.8-Windows.whl
762+
- uses: actions/download-artifact@v2
763+
with:
764+
name: stt-tflite-3.9.4-Windows.whl
765+
- uses: actions/download-artifact@v2
766+
with:
767+
name: stt-tf-3.6-Linux.whl
768+
- uses: actions/download-artifact@v2
769+
with:
770+
name: stt-tf-3.7-Linux.whl
771+
- uses: actions/download-artifact@v2
772+
with:
773+
name: stt-tf-3.8-Linux.whl
774+
- uses: actions/download-artifact@v2
775+
with:
776+
name: stt-tf-3.9-Linux.whl
777+
- uses: actions/download-artifact@v2
778+
with:
779+
name: stt-tflite-3.6-Linux.whl
780+
- uses: actions/download-artifact@v2
781+
with:
782+
name: stt-tflite-3.7-Linux.whl
783+
- uses: actions/download-artifact@v2
784+
with:
785+
name: stt-tflite-3.8-Linux.whl
786+
- uses: actions/download-artifact@v2
787+
with:
788+
name: stt-tflite-3.9-Linux.whl
789+
- uses: actions/download-artifact@v2
790+
with:
791+
name: stt-tflite-3.7-armv7.whl
792+
- uses: actions/download-artifact@v2
793+
with:
794+
name: stt-tflite-3.7-aarch64.whl
795+
- name: Setup PyPI config
796+
run: |
797+
cat << EOF > ~/.pypirc
798+
[pypi_stt]
799+
username=__token__
800+
password=${{ secrets.PYPI_STT_TOKEN }}
801+
[pypi_tflite]
802+
username=__token__
803+
password=${{ secrets.PYPI_TFLITE_TOKEN }}
804+
EOF
805+
- run: |
806+
twine upload --repository pypi_stt stt-*.whl
807+
twine upload --repository pypi_tflite stt_tflite-*.whl
704808
# macOS jobs
705809
swig_macOS:
706810
name: "Mac|Build SWIG"

0 commit comments

Comments
 (0)