From a0beef32b37dae97575a36a4e387da0b2640d9c6 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Sat, 22 Oct 2022 14:54:37 +0100 Subject: [PATCH 1/3] add drone yaml --- .drone.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 679ba4e..75f2af9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,10 +1,30 @@ kind: pipeline -name: test +type: docker +name: test and build steps: - - name: test & build + - name: test image: python:3.7 commands: - pip install poetry - poetry install - - poetry run pytest \ No newline at end of file + - poetry run pytest + + - name: publish + when: + branch: + - master + image: python3.7 + environment: + GITEA_PACKAGE_REPO: + from_secret: gitea_package_repo + GITEA_OWNER: + from_secret: gitea_owner + GITEA_TOKEN: + from_secret: gitea_token + commands: + - pip install poetry twine + - poetry build + - echo "[distutils]\nindex-servers = gitea\n\n[gitea]\nrepository = ${GITEA_PACKAGE_REPO}\nusername = ${GITEA_OWNER}\npassword = ${GITEA_TOKEN}" + + From b5d8323b0148b06a88e7329fac5ed9f41deda40e Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Sat, 22 Oct 2022 14:57:59 +0100 Subject: [PATCH 2/3] add twine build step to ci --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 75f2af9..17ec91b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,5 +26,6 @@ steps: - pip install poetry twine - poetry build - echo "[distutils]\nindex-servers = gitea\n\n[gitea]\nrepository = ${GITEA_PACKAGE_REPO}\nusername = ${GITEA_OWNER}\npassword = ${GITEA_TOKEN}" + - twine upload -r gitea ./dist/*.whl From e825b466072d61cae769dcd6db9af056dbcc9299 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Sat, 22 Oct 2022 15:01:06 +0100 Subject: [PATCH 3/3] exclude publish step during PRs --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index 17ec91b..198b2e6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,6 +14,9 @@ steps: when: branch: - master + event: + exclude: + - pull_request image: python3.7 environment: GITEA_PACKAGE_REPO: