File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
build_tools/github_actions Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ jobs:
146146 --index-url "${{ inputs.cloudfront_url }}/${{ inputs.amdgpu_family }}/" \
147147 --clean \
148148 --output-dir ${{ env.PACKAGE_DIST_DIR }} ${{ env.optional_build_prod_arguments }}
149- echo "torch_version=`cd ${{ env.PACKAGE_DIST_DIR }}; python -c 'import glob; print(glob.glob("torch-*.whl")[0].split("-")[1])'`" >> $GITHUB_OUTPUT
149+ python ./build_tools/github_actions/write_torch_version.py
150150
151151 - name : Configure AWS Credentials
152152 if : always()
Original file line number Diff line number Diff line change 6464 PACKAGE_DIST_DIR : ${{ github.workspace }}\output\packages\dist
6565 S3_BUCKET_PY : " therock-${{ inputs.release_type }}-python"
6666 optional_build_prod_arguments : " "
67+ outputs :
68+ torch_version : ${{ steps.build-pytorch-wheels.outputs.torch_version }}
6769 defaults :
6870 run :
6971 # Note: there are mixed uses of 'bash' (this default) and 'cmd' below
@@ -112,6 +114,7 @@ jobs:
112114 --rocm-version ${{ inputs.rocm_version }}
113115
114116 - name : Build PyTorch Wheels
117+ id : build-pytorch-wheels
115118 # Using 'cmd' here is load bearing! There are configuration issues when
116119 # run under 'bash': https://github.com/ROCm/TheRock/issues/827#issuecomment-3025858800
117120 shell : cmd
@@ -126,6 +129,7 @@ jobs:
126129 --clean ^
127130 --output-dir ${{ env.PACKAGE_DIST_DIR }} ^
128131 ${{ env.optional_build_prod_arguments }}
132+ python ./build_tools/github_actions/write_torch_version.py
129133
130134 - name : Configure AWS Credentials
131135 if : always()
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ """Writes torch_version to GITHUB_OUTPUT."""
4+
5+ import os
6+ import glob
7+
8+ from github_actions_utils import *
9+
10+
11+ def main (argv : list [str ]):
12+ # Get the torch version from the first torch wheel in PACKAGE_DIST_DIR.
13+ package_dist_dir = os .getenv ("PACKAGE_DIST_DIR" )
14+ version = glob .glob ("torch-*.whl" , root_dir = package_dist_dir )[0 ].split ("-" )[1 ]
15+ gha_set_output ({"torch_version" : version })
16+
17+
18+ if __name__ == "__main__" :
19+ main (sys .argv [1 :])
You can’t perform that action at this time.
0 commit comments