Merge pull request #20 from Maillol/update-ci

Enable deploy on pypi
This commit is contained in:
MAILLOL Vincent 2021-07-26 07:03:14 +02:00 committed by GitHub
commit 81138cc1c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 13 deletions

View File

@ -39,7 +39,7 @@ local BuildAndTestPipeline(name, image) = {
} }
], ],
trigger: { trigger: {
event: ["push", "tag"] event: ["pull_request", "push", "tag"]
} }
}; };
@ -55,17 +55,22 @@ local BuildAndTestPipeline(name, image) = {
name: "Deploy on Pypi", name: "Deploy on Pypi",
steps: [ steps: [
{ {
name: "Deploy on Pypi", name: "Install twine and deploy",
image: "plugins/pypi", image: "python3.8",
settings: { environment: {
username: { pypi_username: {
from_secret: 'pypi_username' from_secret: 'pypi_username'
}, },
password: { pypi_password: {
from_secret: 'pypi_password' from_secret: 'pypi_password'
} }
}, },
distributions: 'bdist_wheel' commands: [
"pip install --force-reinstall twine wheel",
"python setup.py build bdist_wheel",
"set +x",
"twine upload --non-interactive -u \"$pypi_username\" -p \"$pypi_password\" dist/*"
]
}, },
], ],
trigger: { trigger: {

View File

@ -31,6 +31,7 @@ steps:
trigger: trigger:
event: event:
- pull_request
- push - push
- tag - tag
@ -67,6 +68,7 @@ steps:
trigger: trigger:
event: event:
- pull_request
- push - push
- tag - tag
@ -80,12 +82,17 @@ platform:
arch: amd64 arch: amd64
steps: steps:
- name: Deploy on Pypi - name: Install twine and deploy
image: plugins/pypi image: python3.8
settings: commands:
password: - pip install --force-reinstall twine wheel
- python setup.py build bdist_wheel
- set +x
- twine upload --non-interactive -u "$pypi_username" -p "$pypi_password" dist/*
environment:
pypi_password:
from_secret: pypi_password from_secret: pypi_password
username: pypi_username:
from_secret: pypi_username from_secret: pypi_username
trigger: trigger:
@ -96,4 +103,8 @@ depends_on:
- python-3-8 - python-3-8
- python-3-9 - python-3-9
---
kind: signature
hmac: dfd0429e3b9f364147c56a400cf37466d0cbf0966e613f11b726777553fd9931
... ...

2
.gitignore vendored
View File

@ -1,9 +1,9 @@
.coverage .coverage
.idea/ .idea/
.pypirc
.pytest_cache .pytest_cache
__pycache__ __pycache__
aiohttp_pydantic.egg-info/ aiohttp_pydantic.egg-info/
build/ build/
coverage.xml coverage.xml
dist/ dist/