Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.34 KiB
Newer Older
Anton Akhmerov's avatar
Anton Akhmerov committed
image: ghcr.io/prefix-dev/pixi:0.29.0
Anton Akhmerov's avatar
Anton Akhmerov committed

Anton Akhmerov's avatar
Anton Akhmerov committed
  FF_USE_FASTZIP: "true"
  CACHE_COMPRESSION_LEVEL: "fastest"
Anton Akhmerov's avatar
Anton Akhmerov committed
pre-commit:
  variables:
    PRE_COMMIT_HOME: $CI_PROJECT_DIR/.pre-commit-cache
Anton Akhmerov's avatar
Anton Akhmerov committed
  script:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - pixi run -e precommit git config --global --add safe.directory $CI_PROJECT_DIR
    - pixi run -e precommit check
Anton Akhmerov's avatar
Anton Akhmerov committed
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .pre-commit-cache
      - .pixi
Anton Akhmerov's avatar
Anton Akhmerov committed
test:
  script:
    - pixi run test
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .pixi
      - build
Anton Akhmerov's avatar
Anton Akhmerov committed

build:
Anton Akhmerov's avatar
Anton Akhmerov committed
  script:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - pixi run -e publish uv build --sdist
    - pixi run -e publish twine check dist/*
  artifacts:
    paths:
      - dist
    expire_in: "7 days"
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .pixi

publish to test pypi:
  needs:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - test
    - build
    - pre-commit
  rules:
    - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*\+test$/' # vX.Y.Z.post1+test
  script:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - pixi run -e publish twine upload -u __token__ -p $PYPI_TEST_TOKEN --repository testpypi dist/*
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .pixi

publish to pypi:
  needs:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - test
    - build
    - pre-commit
  rules:
    - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+[^+]*$/' # No +test
  script:
Anton Akhmerov's avatar
Anton Akhmerov committed
    - pixi run -e publish twine upload -u __token__ -p $PYPI_TOKEN dist/*
  cache:
    key: "$CI_JOB_NAME"
    paths:
      - .pixi