diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 8586436e7..0f7bc1a39 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -281,3 +281,37 @@ jobs: ${{runner.temp}}/msys64/mingw64/bin/libwinpthread-1.dll ${{runner.temp}}/msys64/mingw64/lib/libpgf* ${{runner.temp}}/msys64/mingw64/include/pgf + + upload_pypi: + name: Upload to PyPI + needs: [linux-python, macos-python] + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/majestic' && github.event_name == 'push' + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install twine + run: pip install twine + + - uses: actions/download-artifact@v2 + with: + name: python-linux + path: ./dist + + - uses: actions/download-artifact@v2 + with: + name: python-macos + path: ./dist + + - name: Publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: | + (cd ./src/runtime/python && curl -I --fail https://pypi.org/project/$(python setup.py --name)/$(python setup.py --version)/) || twine upload dist/*