kind: pipeline
type: docker
name: default

steps:
- name: static-test
  image: alpine/flake8
  commands:
  - python3 -m flake8 --ignore E501,W503

- name: build
  image: python
  commands:
  - python3 -m pip install build
  - python3 -m build alice-ci

- name: publish
  image: python
  environment:
    TWINE_PASSWORD:
      from_secret: pypi_username
    TWINE_USERNAME:
      from_secret: pypi_token
  commands:
  - python3 -m pip install twine
  - python3 -m twine --verbose upload alice-ci/dist/*
  when:
    branch:
      - master
    event:
      exclude:
      - pull_request