FEAT: Modernized to support latest Pythons and DRF JSONAPI
This commit is contained in:
+42
-10
@@ -1,14 +1,46 @@
|
||||
image: python:3.8
|
||||
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
- publish
|
||||
|
||||
pack:
|
||||
stage: publish
|
||||
script:
|
||||
- pip install twine setuptools
|
||||
- python setup.py sdist bdist_wheel
|
||||
- python -m twine upload -u iruiz --repository-url https://git.ruiz.wang/api/packages/Public/pypi dist/*
|
||||
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
|
||||
|
||||
only:
|
||||
- tags
|
||||
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/*
|
||||
|
||||
Reference in New Issue
Block a user