Skip to content

Commit

Permalink
Update create_release.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Fehlner <[email protected]>
  • Loading branch information
andife authored Nov 28, 2024
1 parent b321389 commit 1d19bcd
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1d19bcd

Please sign in to comment.