zuul-jobs/roles/upload-pypi/tasks/main.yaml

28 lines
764 B
YAML

- name: Install .pypirc configuration file
template:
dest: ~/.pypirc
mode: 0400
src: .pypirc.j2
- name: Find wheels to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.whl"
register: found_wheels
- name: Upload wheel with twine before tarballs
command: "{{ pypi_twine_executable }} upload -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_wheels.files }}"
when: found_wheels.matched|bool
- name: Find tarballs to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.tar.gz"
register: found_tarballs
- name: Upload tarballs with twine
command: "{{ pypi_twine_executable }} upload -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_tarballs.files }}"
when: found_tarballs.matched|bool