diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 9a7ff54e0e8..ad4f9d75cf7 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -76,12 +76,13 @@ jobs: os: "macos" secrets: inherit - publish_devbuild_to_testpypi: + publish_devbuild_to_testpypi: name: Publish devbuild to test.pypi runs-on: ubuntu-latest needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist] if: ${{ always() }} && (github.event.inputs.publish_wheel_testpypi == 'yes' ) # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs + # For devbuilds it is not necessary for all runs to be successful for all different operating systems. Even if only individual OS builds are successful, these are pushed to onnx-weekly environment: name: testpypi_onnxweekly @@ -118,6 +119,45 @@ jobs: ########################################################################################################################## + publish_releasebuild_to_pypi: + name: Publish release (including rc-candidates) to pypi + runs-on: ubuntu-latest + needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist] + if: ${{ always() }} && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs + + environment: + name: pypi-weekly ## TODO: change to correct env before using... + url: https://pypi.org/p/onnx + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write + + steps: + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 + if: (github.event_name == 'workflow_dispatch') && ((needs.call-workflow-mac.result == 'success') && (needs.call-workflow-ubuntu_x86.result == 'success') && (needs.call-workflow-ubuntu_aarch64.result == 'success') && (needs.call-workflow-win.result == 'success')) + with: + pattern: wheels* + path: dist + merge-multiple: true + + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 + if: (github.event_name == 'workflow_dispatch') && (needs.call-workflow-sdist.result == 'success') # TODO: fix, it's probably not workflow_dispatch + with: + pattern: sdist + path: dist + merge-multiple: true + + - name: Publish releasebuild to pypi + if: (github.ref == 'refs/heads/main') && (github.event.inputs.publish_pypi_onnxweekly == 'yes') && (github.repository_owner == 'onnx') + uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc + with: + repository-url: https://upload.pypi.org/legacy/ + verbose: true + print-hash: true + + ########################################################################################################################## + publish_devbuild_to_pypi: name: Publish devbuild to pypi runs-on: ubuntu-latest