Deployment to Github Releases does not work

Hello,
I’m new to Travis and I try to setup a CD for my Python project, but I’m facing several problems.

Problems:

  1. “Skipping a deployment with the releases provider because this branch is not permitted: 20200810114206-c799054”
    I don’t understand this error message. The last part is the tag and not a branch.
  2. During every build process, it creates five releases on Github, not one.
  3. The created releases are empty due to problem number 1.

My travis.yml file:

language: python
python:
  - "3.6"      # current default Python on Travis CI
  - "3.7"
  - "3.8"
  - "3.8-dev"  # 3.8 development branch
  - "nightly"  # nightly build

# command to install dependencies
install:
  - pip install -r requirements.txt
  - pip install wheel

# command to run tests
script:
  - python PythonHelpers/unit_tests/tests_main.py

before_deploy:
  - python setup.py bdist_wheel
  # Set up git user name and tag this commit
  - git config --local user.name "LostInDarkMath"
  - git config --local user.email "32729196+LostInDarkMath@users.noreply.github.com"
  - export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
  - git tag $TRAVIS_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
  - echo $GITHUB_TOKEN

deploy:
  provider: releases  # use Github pages instead: pages 
  token: $GITHUB_TOKEN
  file: dist/PythonHelpers-1.0.0-py3-none-any.whl
  cleanup: false
  overwrite: true
  on:
     branch: master
  #   tags: true

Can someone please help me?

Somehow helped me out and I want to share with you the solution for my problems:

language: python
python:
  - "3.6"      # current default Python on Travis CI
  - "3.7"
  - "3.8"
  - "3.8-dev"  # 3.8 development branch
  - "nightly"  # nightly build

install:
  - pip install -r requirements.txt
  - pip install wheel

script:
  - python PythonHelpers/unit_tests/tests_main.py
  - python setup.py bdist_wheel

before_deploy:
  # Set up git user name and tag this commit
  - git config --local user.name "LostInDarkMath"
  - git config --local user.email "32729196+LostInDarkMath@users.noreply.github.com"
  - export TRAVIS_TAG=${TRAVIS_TAG:-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)}
  - git tag $TRAVIS_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
  - echo $GITHUB_TOKEN

deploy:
  provider: releases  # use Github pages instead: pages 
  token: $GITHUB_TOKEN
  file_glob: true
  file: dist/*.whl
  skip_cleanup: true
  overwrite: true
  on:
    python: 3.8
    branch: master
Imprint