diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 93144acb510def4f3f30cf90b8990178d231b09a..520a5451e113f4bcff30f40b2660a5777f878b83 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -69,8 +69,8 @@ deploy-pypi:
     TWINE_REPOSITORY_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
 
   before_script:
-    - pip install twine
+    - pip install twine build
 
   script:
-    - python setup.py sdist bdist_wheel
+    - python -m build
     - twine upload --repository-url ${TWINE_REPOSITORY_URL} dist/*