47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
stages:
|
|
- test
|
|
- build
|
|
- publish
|
|
|
|
compatibility:
|
|
stage: test
|
|
parallel:
|
|
matrix:
|
|
- PYTHON_VERSION: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
DRF_JSONAPI_VERSION: ["7.1", "8.1"]
|
|
image: "python:${PYTHON_VERSION}"
|
|
script:
|
|
- python -m pip install --upgrade pip
|
|
- python -m pip install -e ".[test]" "djangorestframework-jsonapi~=${DRF_JSONAPI_VERSION}.0"
|
|
- python -m pytest
|
|
|
|
lint:
|
|
stage: test
|
|
image: python:3.14
|
|
script:
|
|
- python -m pip install -e ".[dev]"
|
|
- python -m ruff check .
|
|
|
|
build:
|
|
stage: build
|
|
image: python:3.14
|
|
script:
|
|
- python -m pip install "build>=1.3,<2" "twine>=6,<7"
|
|
- python -m build
|
|
- python -m twine check dist/*
|
|
artifacts:
|
|
paths:
|
|
- dist/
|
|
|
|
publish:
|
|
stage: publish
|
|
image: python:3.14
|
|
needs:
|
|
- job: build
|
|
artifacts: true
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- python -m pip install "twine>=6,<7"
|
|
- TWINE_USERNAME=gitlab-ci-token TWINE_PASSWORD="$CI_JOB_TOKEN" python -m twine upload --repository-url "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/pypi" dist/*
|