diff --git a/roles/upload-pypi/tasks/main.yaml b/roles/upload-pypi/tasks/main.yaml index b3917705f..10e67f25a 100644 --- a/roles/upload-pypi/tasks/main.yaml +++ b/roles/upload-pypi/tasks/main.yaml @@ -1,8 +1,3 @@ -# NOTE(ianw) 2022-07 : If you modify this, see the comments about -# testing in test-playbooks/python/upload-pypi.yaml. Once the change -# is finalised, you should do one run that uploads the sandbox project -# to test.pypi.org to validate the full path. - - name: Validate password/token combo fail: msg: 'Specify either username/password or api_token' diff --git a/test-playbooks/python/upload-pypi.yaml b/test-playbooks/python/upload-pypi.yaml index ee2e0ffe4..3a0e67317 100644 --- a/test-playbooks/python/upload-pypi.yaml +++ b/test-playbooks/python/upload-pypi.yaml @@ -29,23 +29,17 @@ msg: 'upload-pypi did not fail as it should' when: _role_failed is not true + # We tag this with the unix timestamp so that the upload always + # has an increasing version number. - name: Import sandbox project shell: | git clone https://opendev.org/opendev/sandbox pushd sandbox + git tag $(date '+%s') python3 setup.py bdist_wheel args: executable: '/bin/bash' - # NOTE(ianw) 2022-07 : You can not upload the same release twice, - # so this is disabled by default. Before we commit changes to the - # upload-pypi role, we should do one test run with this - # uncommented to validate the entire path, then re-comment it for - # the final commit. - - name: Run full upload - set_fact: - _run_full_upload: false - # This value is restricted to uploading the sandbox package to # test.pypi.org; it is not kept in plain text to avoid things that # grep for accidentally committed tokens finding it, but it is not @@ -67,4 +61,3 @@ api_token: '{{ _api_token | b64decode }}' repository: testpypi pypi_path: '{{ ansible_user_dir }}/sandbox/dist' - when: _run_full_upload