File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,20 @@ The action invocation in this case would look like:
86
86
repository_url: https://test.pypi.org/legacy/
87
87
` ` `
88
88
89
+ # ## Customizing target package dists directory
90
+
91
+ You can change the default target directory of `dist/`
92
+ to any directory of your liking. The action invocation
93
+ would now look like :
94
+
95
+ ` ` ` yml
96
+ - name: Publish package to PyPI
97
+ uses: pypa/gh-action-pypi-publish@master
98
+ with:
99
+ user: __token__
100
+ password: ${{ secrets.pypi_password }}
101
+ packages-dir: custom-dir/
102
+ ` ` `
89
103
90
104
# # License
91
105
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ inputs:
12
12
repository_url :
13
13
description : The repository URL to use
14
14
required : false
15
+ packages-dir :
16
+ description : The target directory for distribution
17
+ required : false
18
+ default : dist
15
19
branding :
16
20
color : yellow
17
21
icon : upload-cloud
22
26
- ${{ inputs.user }}
23
27
- ${{ inputs.password }}
24
28
- ${{ inputs.repository_url }}
29
+ - ${{ inputs.packages-dir }}
Original file line number Diff line number Diff line change 17
17
fi
18
18
19
19
if [[
20
- ! -d dist / ||
21
- " ` ls -l dist/ * .tar.gz dist /* .whl` " == " total 0"
20
+ ! -d ${INPUT_PACKAGES_DIR %%/ } / ||
21
+ " ` ls -l ${INPUT_PACKAGES_DIR %%/ } / * .tar.gz ${INPUT_PACKAGES_DIR %%/ } /* .whl` " == " total 0"
22
22
]]
23
23
then
24
24
>&2 echo \
25
25
[WARNING]: \
26
26
It looks like there are no Python distribution packages to \
27
- publish in the ' "dist/" ' directory . Please verify that they \
27
+ publish in the directory ' "${INPUT_PACKAGES_DIR%%/}/" ' . Please verify that they \
28
28
are in place should you face this problem.
29
29
fi
30
30
31
31
32
32
TWINE_USERNAME=" $INPUT_USER " \
33
33
TWINE_PASSWORD=" $INPUT_PASSWORD " \
34
34
TWINE_REPOSITORY_URL=" $INPUT_REPOSITORY_URL " \
35
- exec twine upload dist /*
35
+ exec twine upload ${INPUT_PACKAGES_DIR %%/ } /*
You can’t perform that action at this time.
0 commit comments