Skip to content

Commit cc5bde8

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

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

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

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,109 @@ 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+
steps:
709+
- uses: actions/setup-python@v2
710+
with:
711+
python-version: 3.8
712+
- name: Update pip and install twine
713+
run: |
714+
python -m pip install -U pip
715+
python -m pip install -U twine
716+
- uses: actions/download-artifact@v2
717+
with:
718+
name: stt-tf-3.6.8-macOS.whl
719+
- uses: actions/download-artifact@v2
720+
with:
721+
name: stt-tf-3.7.9-macOS.whl
722+
- uses: actions/download-artifact@v2
723+
with:
724+
name: stt-tf-3.8.9-macOS.whl
725+
- uses: actions/download-artifact@v2
726+
with:
727+
name: stt-tf-3.9.4-macOS.whl
728+
- uses: actions/download-artifact@v2
729+
with:
730+
name: stt-tflite-3.6.8-macOS.whl
731+
- uses: actions/download-artifact@v2
732+
with:
733+
name: stt-tflite-3.7.9-macOS.whl
734+
- uses: actions/download-artifact@v2
735+
with:
736+
name: stt-tflite-3.8.9-macOS.whl
737+
- uses: actions/download-artifact@v2
738+
with:
739+
name: stt-tflite-3.9.4-macOS.whl
740+
- uses: actions/download-artifact@v2
741+
with:
742+
name: stt-tf-3.6.8-Windows.whl
743+
- uses: actions/download-artifact@v2
744+
with:
745+
name: stt-tf-3.7.9-Windows.whl
746+
- uses: actions/download-artifact@v2
747+
with:
748+
name: stt-tf-3.8.8-Windows.whl
749+
- uses: actions/download-artifact@v2
750+
with:
751+
name: stt-tf-3.9.4-Windows.whl
752+
- uses: actions/download-artifact@v2
753+
with:
754+
name: stt-tflite-3.6.8-Windows.whl
755+
- uses: actions/download-artifact@v2
756+
with:
757+
name: stt-tflite-3.7.9-Windows.whl
758+
- uses: actions/download-artifact@v2
759+
with:
760+
name: stt-tflite-3.8.8-Windows.whl
761+
- uses: actions/download-artifact@v2
762+
with:
763+
name: stt-tflite-3.9.4-Windows.whl
764+
- uses: actions/download-artifact@v2
765+
with:
766+
name: stt-tf-3.6-Linux.whl
767+
- uses: actions/download-artifact@v2
768+
with:
769+
name: stt-tf-3.7-Linux.whl
770+
- uses: actions/download-artifact@v2
771+
with:
772+
name: stt-tf-3.8-Linux.whl
773+
- uses: actions/download-artifact@v2
774+
with:
775+
name: stt-tf-3.9-Linux.whl
776+
- uses: actions/download-artifact@v2
777+
with:
778+
name: stt-tflite-3.6-Linux.whl
779+
- uses: actions/download-artifact@v2
780+
with:
781+
name: stt-tflite-3.7-Linux.whl
782+
- uses: actions/download-artifact@v2
783+
with:
784+
name: stt-tflite-3.8-Linux.whl
785+
- uses: actions/download-artifact@v2
786+
with:
787+
name: stt-tflite-3.9-Linux.whl
788+
- uses: actions/download-artifact@v2
789+
with:
790+
name: stt-tflite-3.7-armv7.whl
791+
- uses: actions/download-artifact@v2
792+
with:
793+
name: stt-tflite-3.7-aarch64.whl
794+
- name: Setup PyPI config
795+
run: |
796+
cat << EOF > ~/.pypirc
797+
[pypi_stt]
798+
username=__token__
799+
password=${{ secrets.PYPI_STT_TOKEN }}
800+
[pypi_tflite]
801+
username=__token__
802+
password=${{ secrets.PYPI_TFLITE_TOKEN }}
803+
EOF
804+
- run: |
805+
twine upload --repository pypi_stt stt-*.whl
806+
twine upload --repository pypi_tflite stt_tflite-*.whl
704807
# macOS jobs
705808
swig_macOS:
706809
name: "Mac|Build SWIG"

0 commit comments

Comments
 (0)