---
- name: Prepare wheels for publishing  # noqa no-changed-when
  ansible.builtin.shell:
    cmd: |
      set -xe
      for pkg in *.whl
      do
        pkgdir=$(echo `basename $pkg`|cut -d'-' -f1 | tr '[:upper:]_' '[:lower:]-')
        mkdir -p "{{ wheels_dir }}/$pkgdir"
        mv $pkg  "{{ wheels_dir }}/$pkgdir"
      done
      chown -R buildslave:buildslave *
    chdir: "{{ wheels_dir }}"
    executable: "/bin/bash"
