zuul-jobs/roles/upload-pypi/tasks/main.yaml
Doug Hellmann b5e6652c72 add more debugging to the upload-pypi role
Show the files discovered for upload.

Change-Id: I74279e8901f7790d935ce664b8026a4acf8b7ba4
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-10-23 13:25:26 -04:00

46 lines
1.3 KiB
YAML

- name: Create .pypirc configuration file tempfile
tempfile:
state: file
register: _pypirc_tmp
- name: Create .pypirc configuration file
template:
dest: "{{ _pypirc_tmp.path }}"
mode: 0400
src: .pypirc.j2
- name: Find wheels to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.whl"
register: found_wheels
- name: Report no wheels to be uploaded
debug:
msg: "Found no wheels to upload: {{found_wheels.msg}}"
when: found_wheels.files == []
- name: Upload wheel with twine before tarballs
command: "{{ pypi_twine_executable }} upload --config-file {{ _pypirc_tmp.path }} -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_wheels.files }}"
- name: Find tarballs to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.tar.gz"
register: found_tarballs
- name: Report no tarballs to be uploaded
debug:
msg: "Found no tarballs to upload: {{found_tarballs.msg}}"
when: found_tarballs.files == []
- name: Upload tarballs with twine
command: "{{ pypi_twine_executable }} upload --config-file {{ _pypirc_tmp.path }} -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_tarballs.files }}"
- name: Delete .pypirc configuration file
file:
path: "{{ _pypirc_tmp.path }}"
state: absent