From 9a138cc9e6370c5c7c4b6ab67a16ca34b24a4934 Mon Sep 17 00:00:00 2001 From: PabloLec Date: Fri, 4 Jun 2021 16:21:48 +0200 Subject: [PATCH] Add GH integration --- action.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ entrypoint.sh | 8 ++++++++ 2 files changed, 53 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..2c310ea --- /dev/null +++ b/action.yml @@ -0,0 +1,45 @@ +name: pypi-github-sync +description: "Sync a PyPI package with Github release" +author: Pablo Lecolinet +branding: + color: green + icon: send +inputs: + github_repo: + description: GitHub repo name with format USERNAME/REPO + required: true + twine_username: + description: Your PyPI username (use your GitHub repo secrets) + required: true + twine_password: + description: Your PyPI password (use your GitHub repo secrets) + required: true + + upload_repo: + description: Repo to upload to with twine, defaults to main PyPI repo + required: false + defaults: https://pypi.org/ + verify_metadata: + description: Verify build metadata before publication, defaults to false + required: false + defaults: false + skip_existing: + description: Do not raise an error if version already exists on repo, defaults to false + required: false + defaults: false + verbose: + description: Verbose output for twine upload, defaults to false + required: false + defaults: false + +runs: + using: "docker" + image: "Dockerfile" + args: + - ${{ inputs.github_repo }} + - ${{ inputs.twine_username }} + - ${{ inputs.twine_password }} + - ${{ inputs.upload_repo }} + - ${{ inputs.verify_metadata }} + - ${{ inputs.skip_existing }} + - ${{ inputs.verbose }} diff --git a/entrypoint.sh b/entrypoint.sh index fbf7de5..319dc84 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,14 @@ set -o errexit -o pipefail -o nounset +GITHUB_REPO=$INPUT_GITHUB_REPO +UPLOAD_REPO=$INPUT_UPLOAD_REPO +TWINE_USERNAME=$INPUT_TWINE_USERNAME +TWINE_PASSWORD=$INPUT_TWINE_PASSWORD +VERIFY_METADATA=$INPUT_VERIFY_METADATA +SKIP_EXISTING=$INPUT_SKIP_EXISTING +VERBOSE=$INPUT_VERBOSE + REPO_NAME=$(cut -d "/" -f2 <<< ${GITHUB_REPO}) echo "---------------- CLONE REPO ----------------"