|
5 | 5 | name: Create Releases
|
6 | 6 | on:
|
7 | 7 | schedule:
|
8 |
| - # Run weekly on Monday 00:00 UTC |
| 8 | + # Run weekly on Monday 00:00 UTC |
9 | 9 | - cron: '00 00 * * MON'
|
10 | 10 | push:
|
11 | 11 | branches: [main, rel-*]
|
12 | 12 | pull_request:
|
13 | 13 | branches: [main, rel-*]
|
14 |
| - types: |
| 14 | + types: |
15 | 15 | - labeled # Trigger when a label is added to a PR, more information: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
|
16 |
| - workflow_dispatch: |
| 16 | + workflow_dispatch: |
| 17 | + inputs: |
| 18 | + publish_pypi_onnxweekly: |
| 19 | + description: 'Publish to pypi_onnxweekly' |
| 20 | + required: true |
| 21 | + type: choice |
| 22 | + options: |
| 23 | + - 'yes' |
| 24 | + - 'no' |
| 25 | + default: 'no' |
| 26 | + publish_testpypi_onnxweekly: |
| 27 | + description: 'Publish to testpypi_onnxweekly' |
| 28 | + required: true |
| 29 | + type: choice |
| 30 | + options: |
| 31 | + - 'yes' |
| 32 | + - 'no' |
| 33 | + default: 'no' |
17 | 34 |
|
18 | 35 | concurrency:
|
19 | 36 | group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
|
20 | 37 | cancel-in-progress: true
|
21 | 38 |
|
22 |
| -jobs: |
| 39 | +jobs: |
23 | 40 |
|
24 | 41 | call-workflow-ubuntu_x86:
|
25 | 42 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
26 | 43 | uses: ./.github/workflows/release_linux_x86_64.yml
|
27 |
| - with: |
28 |
| - os: "linux_x86_64" |
| 44 | + with: |
| 45 | + os: "linux_x86_64" |
29 | 46 | secrets: inherit
|
30 | 47 |
|
31 | 48 | call-workflow-ubuntu_aarch64:
|
32 | 49 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
33 | 50 | uses: ./.github/workflows/release_linux_aarch64.yml
|
34 |
| - with: |
35 |
| - os: "linux_aarch64" |
| 51 | + with: |
| 52 | + os: "linux_aarch64" |
36 | 53 | secrets: inherit
|
37 | 54 |
|
38 | 55 | call-workflow-win:
|
39 | 56 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
40 | 57 | uses: ./.github/workflows/release_win.yml
|
41 |
| - with: |
| 58 | + with: |
42 | 59 | os: "win"
|
43 | 60 | secrets: inherit
|
44 | 61 |
|
45 | 62 | call-workflow-mac:
|
46 | 63 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
47 | 64 | uses: ./.github/workflows/release_mac.yml
|
48 |
| - with: |
| 65 | + with: |
49 | 66 | os: "macos"
|
50 | 67 | secrets: inherit
|
51 | 68 |
|
52 | 69 | call-workflow-sdist:
|
53 | 70 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
54 | 71 | uses: ./.github/workflows/release_sdist.yml
|
55 |
| - with: |
| 72 | + with: |
56 | 73 | os: "macos"
|
57 | 74 | secrets: inherit
|
58 | 75 |
|
59 |
| - publish_to_pypi-onnx-weekly: |
60 |
| - name: Publish to pypi-onnx-weekly |
| 76 | + publish_devbuild_to_testpypi: |
| 77 | + name: Publish devbuild to test.pypi |
| 78 | + runs-on: ubuntu-latest |
| 79 | + needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist] |
| 80 | + if: ${{ always() }} && (github.event.inputs.publish_wheel_testpypi == 'yes' ) |
| 81 | + # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs |
| 82 | + |
| 83 | + environment: |
| 84 | + name: testpypi_onnxweekly |
| 85 | + url: https://test.pypi.org/p/onnx-weekly |
| 86 | + |
| 87 | + permissions: |
| 88 | + contents: write # IMPORTANT: mandatory for making GitHub Releases |
| 89 | + id-token: write |
| 90 | + |
| 91 | + steps: |
| 92 | + |
| 93 | + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 |
| 94 | + 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')) |
| 95 | + with: |
| 96 | + pattern: wheels* |
| 97 | + path: dist |
| 98 | + merge-multiple: true |
| 99 | + |
| 100 | + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 |
| 101 | + if: (github.event_name == 'workflow_dispatch' ) && (needs.call-workflow-sdist.result == 'success') |
| 102 | + with: |
| 103 | + pattern: sdist |
| 104 | + path: dist |
| 105 | + merge-multiple: true |
| 106 | + |
| 107 | + - name: Publish dev-build to test.pypi |
| 108 | + if: (github.ref == 'refs/heads/main') && (github.event.inputs.publish_testpypi_onnxweekly == 'yes') && (github.repository_owner == 'onnx') |
| 109 | + |
| 110 | + uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc |
| 111 | + with: |
| 112 | + repository-url: https://test.pypi.org/legacy/ |
| 113 | + verbose: true |
| 114 | + print-hash: true |
| 115 | + |
| 116 | + |
| 117 | + publish_devbuild_to_pypi: |
| 118 | + name: Publish devbuild to pypi |
61 | 119 | runs-on: ubuntu-latest
|
62 | 120 | needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist]
|
63 |
| - if: ${{ always() }} && (github.event_name == 'schedule') # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs |
64 |
| - |
65 |
| - environment: |
66 |
| - name: pypi-weekly |
| 121 | + 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 |
| 122 | + |
| 123 | + environment: |
| 124 | + name: pypi-weekly |
67 | 125 | url: https://pypi.org/p/onnx-weekly
|
68 | 126 |
|
69 | 127 | permissions:
|
70 | 128 | contents: write # IMPORTANT: mandatory for making GitHub Releases
|
71 |
| - id-token: write # IMPORTANT: mandatory for sigstore |
| 129 | + id-token: write |
72 | 130 |
|
73 | 131 | steps:
|
74 |
| - |
75 | 132 | - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
76 |
| - if: (github.event_name == 'schedule') && ((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')) |
| 133 | + if: (github.event_name == 'schedule' || 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')) |
77 | 134 | with:
|
78 |
| - pattern: wheels* |
| 135 | + pattern: wheels* |
79 | 136 | path: dist
|
80 | 137 | merge-multiple: true
|
81 | 138 |
|
82 | 139 | - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
|
83 |
| - if: (github.event_name == 'schedule') && (needs.call-workflow-sdist.result == 'success') |
| 140 | + if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && (needs.call-workflow-sdist.result == 'success') |
84 | 141 | with:
|
85 |
| - pattern: sdist |
| 142 | + pattern: sdist |
86 | 143 | path: dist
|
87 | 144 | merge-multiple: true
|
88 | 145 |
|
89 |
| - - name: Publish onnx-weekly to PyPI |
90 |
| - if: (github.event_name == 'schedule') && (github.repository_owner == 'onnx') |
91 |
| - uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 |
| 146 | + - name: Publish devbuild to pypi |
| 147 | + if: (github.ref == 'refs/heads/main') && (github.event_name == 'schedule' || github.event.inputs.publish_pypi_onnxweekly == 'yes') && (github.repository_owner == 'onnx') |
| 148 | + uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc |
92 | 149 | with:
|
93 |
| - repository-url: https://pypi.org/legacy/ |
| 150 | + repository-url: https://upload.pypi.org/legacy/ |
94 | 151 | verbose: true
|
95 | 152 | print-hash: true
|
96 | 153 |
|
97 |
| - |
98 |
| - test_sdist: |
99 |
| - needs: [publish_to_pypi-onnx-weekly] |
| 154 | + test_sdist: |
| 155 | + needs: [publish_devbuild_to_pypi] |
100 | 156 | if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
|
101 | 157 | uses: ./.github/workflows/release_test_weekly_sdist.yml
|
102 |
| - with: |
103 |
| - os: "macos" |
| 158 | + with: |
| 159 | + os: "macos" |
104 | 160 | secrets: inherit
|
105 |
| - |
| 161 | + |
106 | 162 |
|
0 commit comments