diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ef9c4af9061b3754484a8e9e4c64ff514586a6f1
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,44 @@
+default:
+  image: python:3.11
+  cache:
+    paths:
+      - .pip-cache/
+  before_script:
+    - python --version
+    - pip install --upgrade pip
+    - pip install build twine
+
+stages:
+  - build
+  # - test
+  - publish
+
+variables:
+  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
+
+build:
+  stage: build
+  script:
+    - python -m build
+  artifacts:
+    paths:
+      - dist/
+  rules:
+    - if: '$CI_COMMIT_BRANCH == "main"'
+
+# test:
+#   stage: test
+#   script:
+#     - pip install pytest
+#     - pip install dist/*.whl
+#     - pytest
+#   rules:
+#     - if: '$CI_COMMIT_BRANCH == "main"'
+
+publish:
+  stage: publish
+  script:
+    - TWINE_PASSWORD=${PYPI_TOKEN} TWINE_USERNAME=__token__ python -m twine upload dist/*
+  rules:
+    - if: $CI_COMMIT_TAG
+    - if: $CI_PIPELINE_SOURCE == "release"