From 19e2c288ae7bc18b072f605e95bc4a94a4cd598c Mon Sep 17 00:00:00 2001 From: Anastasios Pandis Date: Tue, 2 Sep 2025 13:37:42 +0000 Subject: [PATCH 1/2] Added CI/CD pipeline, changed pyproject.toml project name for testing the pipeline --- .gitlab-ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..0837883 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,65 @@ +stages: + - validate + - build + - publish + +variables: + PACKAGE_NAME: sunrise6g-opensdk + +validate-mr: + stage: validate + image: python:3.12-slim + before_script: + - echo "Running validation for merge request..." + - pip install -r requirements.txt + - pip install -e . + - pip install isort black flake8 pytest + script: + - echo "Running linters..." + - isort src tests --check --profile black --filter-files + - black src tests --check --line-length=100 + - flake8 src tests + - echo "Running tests..." + - pytest -v tests/common/test_invoke_edgecloud_clients.py + - pytest -v tests/common/test_invoke_network_clients.py + only: + - merge_requests + +build-package: + stage: build + image: python:3.12-slim + before_script: + - pip install build twine + - pip install -r requirements.txt + - pip install -e . + script: + - echo "Building Python package..." + - python -m build + - echo "Package built successfully" + - ls -la dist/ + artifacts: + paths: + - dist/ + expire_in: 1 day + only: + - main + - develop + - tags + +publish-gitlab: + stage: publish + image: python:3.12-slim + dependencies: + - build-package + before_script: + - pip install twine + script: + - echo "Validating package format..." + - twine check dist/* + - echo "Publishing to Package Registry..." + - TWINE_PASSWORD="$CI_JOB_TOKEN" TWINE_USERNAME="gitlab-ci-token" python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* + - echo "Package published successfully" + only: + - main + - develop + - tags diff --git a/pyproject.toml b/pyproject.toml index 20c2e16..24a3775 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sunrise6g-opensdk" -version = "1.0.5" +version = "1.0.5-test1" description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN solutions." keywords = [ "Federation", -- GitLab From daf27fdb1cf549662ccde90df31acb8733b0a135 Mon Sep 17 00:00:00 2001 From: pandis Date: Wed, 3 Sep 2025 07:58:27 +0000 Subject: [PATCH 2/2] Set project version back to 1.0.5 in pyproject.toml --- .gitlab-ci.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0837883..40698a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ validate-mr: stage: validate image: python:3.12-slim before_script: - - echo "Running validation for merge request..." + - echo "Running merge request validation..." - pip install -r requirements.txt - pip install -e . - pip install isort black flake8 pytest diff --git a/pyproject.toml b/pyproject.toml index 24a3775..20c2e16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sunrise6g-opensdk" -version = "1.0.5-test1" +version = "1.0.5" description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN solutions." keywords = [ "Federation", -- GitLab