2019-08-23 19:13:19 +08:00
|
|
|
#! /usr/bin/env bash
|
2019-08-21 04:48:52 +08:00
|
|
|
set -Eeuo pipefail
|
|
|
|
|
2019-09-12 20:38:56 +08:00
|
|
|
|
|
|
|
if [[
|
|
|
|
"$INPUT_USER" == "__token__" &&
|
|
|
|
! "$INPUT_PASSWORD" =~ ^pypi-
|
|
|
|
]]
|
|
|
|
then
|
|
|
|
>&2 echo \
|
|
|
|
[WARNING]: \
|
|
|
|
It looks like you are trying to use an API token to \
|
|
|
|
authenticate in the package index and your token value does \
|
|
|
|
not start with '"pypi-"' as it typically should. This may \
|
|
|
|
cause an authentication error. Please verify that you have \
|
|
|
|
copied your token properly if such an error occurs.
|
|
|
|
fi
|
|
|
|
|
2019-09-12 23:53:53 +08:00
|
|
|
if [[
|
2019-12-06 07:25:02 +08:00
|
|
|
! -d ${INPUT_DIST%%/}/ ||
|
|
|
|
"`ls -l ${INPUT_DIST%%/}/*.tar.gz ${INPUT_DIST%%/}/*.whl`" == "total 0"
|
2019-09-12 23:53:53 +08:00
|
|
|
]]
|
|
|
|
then
|
|
|
|
>&2 echo \
|
|
|
|
[WARNING]: \
|
2019-09-16 19:01:16 +08:00
|
|
|
It looks like there are no Python distribution packages to \
|
2019-12-06 07:25:02 +08:00
|
|
|
publish in the directory '"${INPUT_DIST%%/}/"'. Please verify that they \
|
2019-09-12 23:53:53 +08:00
|
|
|
are in place should you face this problem.
|
|
|
|
fi
|
|
|
|
|
2019-09-12 20:38:56 +08:00
|
|
|
|
2019-08-23 19:17:10 +08:00
|
|
|
TWINE_USERNAME="$INPUT_USER" \
|
|
|
|
TWINE_PASSWORD="$INPUT_PASSWORD" \
|
|
|
|
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \
|
2019-12-06 07:25:02 +08:00
|
|
|
exec twine upload ${INPUT_DIST%%/}/*
|