mirror of
https://github.com/pypa/gh-action-pypi-publish.git
synced 2024-11-24 17:40:59 -05:00
Custom dist
This commit is contained in:
parent
ae9c4b332a
commit
4f4304928f
3 changed files with 23 additions and 4 deletions
14
README.md
14
README.md
|
@ -86,6 +86,20 @@ The action invocation in this case would look like:
|
|||
repository_url: https://test.pypi.org/legacy/
|
||||
```
|
||||
|
||||
## Target Directory
|
||||
|
||||
You can change the default target directory of `dist/`
|
||||
to any directory of your liking. The action invocation
|
||||
would now look like:
|
||||
|
||||
```yml
|
||||
- name: Publish package to TestPyPI
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.test_pypi_password }}
|
||||
dist: custom-dir/
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -12,6 +12,10 @@ inputs:
|
|||
repository_url:
|
||||
description: The repository URL to use
|
||||
required: false
|
||||
dist:
|
||||
description: The target directory for distribution
|
||||
required: false
|
||||
default: dist
|
||||
branding:
|
||||
color: yellow
|
||||
icon: upload-cloud
|
||||
|
@ -22,3 +26,4 @@ runs:
|
|||
- ${{ inputs.user }}
|
||||
- ${{ inputs.password }}
|
||||
- ${{ inputs.repository_url }}
|
||||
- ${{ inputs.dist }}
|
||||
|
|
|
@ -17,14 +17,14 @@ then
|
|||
fi
|
||||
|
||||
if [[
|
||||
! -d dist/ ||
|
||||
"`ls -l dist/*.tar.gz dist/*.whl`" == "total 0"
|
||||
! -d ${INPUT_DIST%%/}/ ||
|
||||
"`ls -l ${INPUT_DIST%%/}/*.tar.gz ${INPUT_DIST%%/}/*.whl`" == "total 0"
|
||||
]]
|
||||
then
|
||||
>&2 echo \
|
||||
[WARNING]: \
|
||||
It looks like there are no Python distribution packages to \
|
||||
publish in the '"dist/"' directory. Please verify that they \
|
||||
publish in the directory '"${INPUT_DIST%%/}/"'. Please verify that they \
|
||||
are in place should you face this problem.
|
||||
fi
|
||||
|
||||
|
@ -32,4 +32,4 @@ fi
|
|||
TWINE_USERNAME="$INPUT_USER" \
|
||||
TWINE_PASSWORD="$INPUT_PASSWORD" \
|
||||
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \
|
||||
exec twine upload dist/*
|
||||
exec twine upload ${INPUT_DIST%%/}/*
|
||||
|
|
Loading…
Reference in a new issue