1111 required : true
1212 type : string
1313 description : ' The docker image which will be used to build'
14+ ref :
15+ required : false
16+ type : string
17+ default : ' refs/heads/main'
18+ description : ' The branch, tag or SHA to checkout'
1419 outputs :
20+ torch_version :
21+ description : ' The version of PyTorch'
22+ value : ${{ jobs.build.outputs.torch_version }}
1523 artifact_name :
16- description : ' The torch distribution artifact name'
24+ description : ' The distribution artifact name of PyTorch '
1725 value : ${{ jobs.build.outputs.dist_name }}
1826
1927# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
3846 SOCKS_PROXY : socks5://127.0.0.1:10808
3947 outputs :
4048 dist_name : ${{ steps.list-dist.outputs.dist_name }}
49+ torch_version : ${{ steps.list-dist.outputs.torch_version }}
4150 steps :
4251 - name : Config mirrors
4352 run : |
@@ -54,12 +63,11 @@ jobs:
5463 run : |
5564 git config --global --add safe.directory "$GITHUB_WORKSPACE"
5665
57- # TODO
5866 - name : Checkout PyTorch
5967 uses : actions/checkout@v4
6068 with :
6169 repository : pytorch/pytorch
62- ref : refs/pull/142477/merge
70+ ref : ${{ inputs.ref }}
6371 submodules : recursive
6472 path : pytorch
6573
8492 run : |
8593 dist_name=$(ls *.whl)
8694 dist_path=$(pwd)/${dist_name}
95+ torch_version=$(python -c "import torch; print(torch.__version__)")
8796 echo "dist_name=${dist_name}" >> $GITHUB_OUTPUT
8897 echo "dist_path=${dist_path}" >> $GITHUB_OUTPUT
98+ echo "torch_version=${torch_version}" >> $GITHUB_OUTPUT
8999
90100 - name : Upload distribution artifact
91101 id : upload-dist
@@ -101,5 +111,5 @@ jobs:
101111 - name : Write to workflow job summary
102112 if : ${{ steps.upload-dist.outputs.artifact-url }}
103113 run : |
104- echo "## torch built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
114+ echo "## torch-${{ steps.list-dist.outputs.torch_version }} built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY
105115 echo "You can download the distribution package [here](${{ steps.upload-dist.outputs.artifact-url }})." >> $GITHUB_STEP_SUMMARY
0 commit comments