|
12 | 12 | pytorch_version: |
13 | 13 | required: true |
14 | 14 | type: string |
15 | | - do-upload: |
16 | | - required: false |
17 | | - default: true |
18 | | - type: boolean |
19 | | - secrets: |
20 | | - PYPI_TOKEN: |
21 | | - required: false |
22 | 15 |
|
23 | 16 | permissions: |
24 | 17 | id-token: write |
@@ -47,173 +40,9 @@ jobs: |
47 | 40 | echo "type=$RELEASE_TYPE" >> $GITHUB_OUTPUT |
48 | 41 | id: get_release_type |
49 | 42 |
|
50 | | - wheel_build_test: |
51 | | - needs: get_release_type |
52 | | - runs-on: ${{ matrix.os }} |
53 | | - container: ${{ startsWith( matrix.os, 'ubuntu' ) && 'pytorch/manylinux-cpu' || null }} |
54 | | - strategy: |
55 | | - fail-fast: false |
56 | | - matrix: |
57 | | - os: |
58 | | - - windows-latest |
59 | | - python-version: |
60 | | - - 3.9 |
61 | | - - "3.10" |
62 | | - - "3.11" |
63 | | - - "3.12" |
64 | | - - "3.13" |
65 | | - - pure |
66 | | - exclude: |
67 | | - - os: windows-latest |
68 | | - python-version: pure |
69 | | - steps: |
70 | | - - name: Checkout Source Repository |
71 | | - uses: actions/checkout@v4 |
72 | | - with: |
73 | | - ref: ${{ inputs.branch }} |
74 | | - submodules: recursive |
75 | | - - name: Setup Python ${{ matrix.python-version }} for Windows |
76 | | - if: ${{ startsWith( matrix.os, 'windows' ) }} |
77 | | - uses: actions/setup-python@v5 |
78 | | - with: |
79 | | - python-version: ${{ matrix.python-version }} |
80 | | - - name: Add temp runner environment variables |
81 | | - if: ${{ startsWith( matrix.os, 'macos' ) }} |
82 | | - shell: bash -l {0} |
83 | | - run: | |
84 | | - echo "MINICONDA_INSTALL_PATH_MACOS=${RUNNER_TEMP}/miniconda" >> "${GITHUB_ENV}" |
85 | | - - name: Setup msbuild on Windows |
86 | | - if: startsWith( matrix.os, 'windows' ) |
87 | | - uses: microsoft/setup-msbuild@v1.1 |
88 | | - - name: Set up Visual Studio shell |
89 | | - if: startsWith( matrix.os, 'windows' ) |
90 | | - uses: egor-tensin/vs-shell@v2 |
91 | | - with: |
92 | | - arch: x64 |
93 | | - - name: Install Build Dependency |
94 | | - shell: bash -l {0} |
95 | | - env: |
96 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
97 | | - run: | |
98 | | - pip install cmake ninja setuptools |
99 | | - echo "/home/runner/.local/bin" >> $GITHUB_PATH |
100 | | - - name: Install PyTorch and Build TorchData Wheel |
101 | | - shell: bash -l {0} |
102 | | - env: |
103 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
104 | | - PYTORCH_VERSION: ${{ inputs.pytorch_version }} |
105 | | - BUILD_S3: 0 |
106 | | - run: | |
107 | | - set -ex |
108 | | - packaging/build_wheel.sh |
109 | | - - name: Validate TorchData Wheel |
110 | | - shell: bash -l {0} |
111 | | - env: |
112 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
113 | | - run: | |
114 | | - pip3 install pkginfo |
115 | | - for pkg in dist/torchdata*.whl; do |
116 | | - echo "PkgInfo of $pkg:" |
117 | | - pkginfo $pkg |
118 | | - if ${{ startsWith( matrix.os, 'ubuntu' ) && matrix.python-version != 'pure' }}; then |
119 | | - auditwheel show $pkg |
120 | | - auditwheel repair $pkg --plat manylinux2014_x86_64 -w wheelhouse |
121 | | - fi |
122 | | - done |
123 | | - - name: Install TorchData Wheel |
124 | | - shell: bash -l {0} |
125 | | - env: |
126 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
127 | | - run: | |
128 | | - pip3 install dist/torchdata*.whl |
129 | | - - name: Run Smoke Tests |
130 | | - shell: bash -l {0} |
131 | | - env: |
132 | | - PYTHON_VERSION: ${{ matrix.python-version }} |
133 | | - run: | |
134 | | - if ${{ matrix.python-version == 'pure' }}; then |
135 | | - python test/smoke_test/smoke_test.py --no-s3 |
136 | | - else |
137 | | - python test/smoke_test/smoke_test.py |
138 | | - fi |
139 | | -
|
140 | | - - name: Upload Wheels to Github |
141 | | - if: always() |
142 | | - uses: actions/upload-artifact@v4 |
143 | | - with: |
144 | | - name: torchdata-artifact-${{ matrix.os }}-${{ matrix.python-version }} |
145 | | - path: dist/torchdata*.whl |
146 | | - |
147 | | - wheel_upload: |
148 | | - if: always() && inputs.branch != '' && inputs.do-upload == true |
149 | | - needs: [get_release_type, wheel_build_test] |
150 | | - runs-on: ubuntu-latest |
151 | | - environment: pytorchbot-env |
152 | | - outputs: |
153 | | - upload: ${{ steps.trigger_upload.outputs.value }} |
154 | | - steps: |
155 | | - - name: Configure aws credentials (pytorch account) |
156 | | - if: ${{ needs.get_release_type.outputs.type == 'nightly' }} |
157 | | - uses: aws-actions/configure-aws-credentials@v3 |
158 | | - with: |
159 | | - role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels |
160 | | - aws-region: us-east-1 |
161 | | - |
162 | | - - name: Configure aws credentials (pytorch account) |
163 | | - if: ${{ needs.get_release_type.outputs.type == 'test' }} |
164 | | - uses: aws-actions/configure-aws-credentials@v3 |
165 | | - with: |
166 | | - role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_test_build_wheels |
167 | | - aws-region: us-east-1 |
168 | | - - name: Download Artifacts from Github |
169 | | - continue-on-error: true |
170 | | - uses: actions/download-artifact@v4 |
171 | | - with: |
172 | | - pattern: torchdata-artifact-* |
173 | | - merge-multiple: true |
174 | | - - name: Determine if Wheel Uploading is needed |
175 | | - run: | |
176 | | - upload=false |
177 | | - for txt in torchdata*.whl; do |
178 | | - upload=true |
179 | | - break |
180 | | - done |
181 | | - echo "value=$upload" >> $GITHUB_OUTPUT |
182 | | - id: trigger_upload |
183 | | - - name: Display All TorchData Wheels |
184 | | - if: steps.trigger_upload.outputs.value == 'true' |
185 | | - run: ls -lh torchdata*.whl |
186 | | - - name: Upload Wheels to S3 Storage |
187 | | - if: steps.trigger_upload.outputs.value == 'true' |
188 | | - run: | |
189 | | - if [[ ${{ inputs.branch }} == 'main' ]]; then |
190 | | - S3_PATH=s3://pytorch/whl/nightly/ |
191 | | - else |
192 | | - S3_PATH=s3://pytorch/whl/test/ |
193 | | - fi |
194 | | - pip3 install awscli |
195 | | - set -x |
196 | | - for pkg in torchdata*.whl; do |
197 | | - aws s3 cp "$pkg" "$S3_PATH" --acl public-read |
198 | | - done |
199 | | - - name: Upload Official Wheels to PYPI |
200 | | - if: | |
201 | | - steps.trigger_upload.outputs.value == 'true' && |
202 | | - needs.get_release_type.outputs.type == 'official' |
203 | | - env: |
204 | | - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
205 | | - run: | |
206 | | - pip3 install twine |
207 | | - python -m twine upload \ |
208 | | - --username __token__ \ |
209 | | - --password "$PYPI_TOKEN" \ |
210 | | - torchdata*.whl |
211 | | -
|
212 | 43 | build_docs: |
213 | | - if: | |
214 | | - always() && inputs.branch != '' && |
215 | | - ( needs.wheel_upload.outputs.upload == 'true') |
216 | | - needs: [get_release_type, wheel_upload] |
| 44 | + if: always() && inputs.branch != '' |
| 45 | + needs: get_release_type |
217 | 46 | runs-on: ubuntu-latest |
218 | 47 | steps: |
219 | 48 | - name: Setup Python 3.9 |
|
0 commit comments