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