35
35
contents : write
36
36
outputs :
37
37
pt_release_name : ${{ steps.release_name.outputs.pt_release_name }}
38
+ pt_pep517_release_name : ${{ steps.release_name.outputs.pt_pep517_release_name }}
38
39
steps :
39
40
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40
41
with :
@@ -55,32 +56,48 @@ jobs:
55
56
tag_or_branch="${tag_or_branch//\//_}"
56
57
echo "PT_RELEASE_NAME=pytorch-$tag_or_branch" >> "$GITHUB_ENV"
57
58
echo "PT_RELEASE_FILE=pytorch-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
59
+ echo "PT_PEP517_RELEASE_FILE=torch-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
58
60
- name : Create source distribution
59
61
run : |
60
- # Create new folder with specified name so extracting the archive yields that
61
- rm -rf "/tmp/$PT_RELEASE_NAME"
62
- cp -r "$PWD" "/tmp/$PT_RELEASE_NAME"
63
- mv "/tmp/$PT_RELEASE_NAME" .
64
- # Cleanup
65
- rm -rf "$PT_RELEASE_NAME"/{.circleci,.ci}
66
- find "$PT_RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
67
- # Create archive
68
- tar -czf "$PT_RELEASE_FILE" "$PT_RELEASE_NAME"
69
- echo "Created source archive $PT_RELEASE_FILE with content: $(ls -a "$PT_RELEASE_NAME")"
62
+ # Create new folder with specified name so extracting the archive yields that
63
+ rm -rf "/tmp/$PT_RELEASE_NAME"
64
+ cp -r "$PWD" "/tmp/$PT_RELEASE_NAME"
65
+ mv "/tmp/$PT_RELEASE_NAME" .
66
+ # Cleanup
67
+ rm -rf "$PT_RELEASE_NAME"/{.circleci,.ci}
68
+ find "$PT_RELEASE_NAME" -name '.git*' -exec rm -rv {} \; || true
69
+ # Create archive
70
+ tar -czf "$PT_RELEASE_FILE" "$PT_RELEASE_NAME"
71
+ echo "Created source archive $PT_RELEASE_FILE with content: $(ls -a "$PT_RELEASE_NAME")"
72
+ - name : Create PEP 517 compatible source distribution
73
+ run : |
74
+ pip install build==1.2.2.post1 || exit 1
75
+ python -m build --sdist || exit 1
76
+ cd dist || exit 1
70
77
- name : Upload source distribution for release
71
78
if : ${{ github.event_name == 'release' }}
72
79
uses : softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
73
80
with :
74
- files : ${{env.PT_RELEASE_FILE}}
81
+ files :
82
+ - ${{ env.PT_RELEASE_FILE }}
83
+ - ${{ env.PT_PEP517_RELEASE_FILE }}
75
84
- name : Upload source distribution to GHA artifacts for release tags
76
85
if : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
77
86
uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
78
87
with :
79
88
name : ${{ env.PT_RELEASE_FILE }}
80
89
path : ${{ env.PT_RELEASE_FILE }}
90
+ - name : Upload PEP 517 source distribution to GHA artifacts for release tags
91
+ if : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
92
+ uses : actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
93
+ with :
94
+ name : ${{ env.PT_PEP517_RELEASE_FILE }}
95
+ path : ${{ env.PT_PEP517_RELEASE_FILE }}
81
96
- name : Set output
82
97
id : release_name
83
- run : echo "name=pt_release_name::${{ env.PT_RELEASE_NAME }}.tar.gz" >> "${GITHUB_OUTPUT}"
98
+ run : |
99
+ echo "name=pt_release_name::${{ env.PT_RELEASE_FILE }}" >> "${GITHUB_OUTPUT}"
100
+ echo "name=pt_pep517_release_name::${{ env.PT_PEP517_RELEASE_FILE }}" >> "${GITHUB_OUTPUT}"
84
101
85
102
upload_source_code_to_s3 :
86
103
if : ${{ github.repository == 'pytorch/pytorch' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc') }}
96
113
- uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
97
114
with :
98
115
name : ${{ needs.release.outputs.pt_release_name }}
116
+ - uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
117
+ with :
118
+ name : ${{ needs.release.outputs.pt_pep517_release_name }}
99
119
- name : Configure AWS credentials(PyTorch account)
100
120
uses : aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
101
121
with :
@@ -106,7 +126,9 @@ jobs:
106
126
s3-bucket : pytorch
107
127
s3-prefix : source_code/test
108
128
if-no-files-found : warn
109
- path : ${{ needs.release.outputs.pt_release_name }}
129
+ path : |
130
+ ${{ needs.release.outputs.pt_release_name }}
131
+ ${{ needs.release.outputs.pt_pep517_release_name }}
110
132
111
133
concurrency :
112
134
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name }}
0 commit comments