Commit 65c5f5fc authored by nimrod's avatar nimrod
Browse files

General Python template.

- Rename the PyPI upload template.
- Add wheel build and test install jobs.
parent 6c9735fa
Loading
Loading
Loading
Loading
+30 −8
Original line number Diff line number Diff line
---
include:
  - project: shore/ci-templates
    file: templates/gitlab-release.yml
.build-wheel:
  tags: [ns4.shore.co.il]
  stage: build
  image: python:slim
  script:
    - python setup.py check --verbose --metadata --restructuredtext --strict
    - python setup.py bdist_wheel
  artifacts:
    paths:
      - dist/*.whl

.install-wheel:
  tags: [ns4.shore.co.il]
  stage: test
  image: python:slim
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
  script:
    - pip install dist/*.whl
  needs:
    - job: build-wheel
      artifacts: true
  cache:
    paths:
      - .cache/

pypi-upload:
  stage: deploy
  tags: [ns4.shore.co.il]
  stage: deploy
  image: python:slim
  before_script:
    - pip install twine
    - mv "$pypirc" $HOME/.pypirc
  script:
    - python setup.py bdist_wheel
    - twine check dist/*
    - twine upload dist/*
  variables:
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
@@ -20,6 +42,6 @@ pypi-upload:
      - .cache/
  rules:
    - if: $CI_COMMIT_TAG
  artifacts:
    paths:
      - dist/*.whl
  needs:
    - job: build-wheel
      artifacts: true