diff --git a/.gitlab/workflows/release.yml b/.gitlab/workflows/release.yml index 1be468bb..51272517 100644 --- a/.gitlab/workflows/release.yml +++ b/.gitlab/workflows/release.yml @@ -23,6 +23,48 @@ release-publish: script: - echo "Running the release job." stage: release +container-publish: + image: docker:latest + needs: + - release-publish + parallel: + matrix: + - PYTHON_VERSION: + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' + rules: + - if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/ + script: + - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} + - | + docker buildx build \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + --cache-from type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION} \ + --cache-to type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION},mode=max \ + --provenance false \ + --push \ + --tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION} \ + --tag ${CI_REGISTRY_IMAGE}:dev-py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ + --target dev \ + .devcontainer/Dockerfile + - | + docker buildx build \ + --build-arg PDM_BUILD_SCM_VERSION=${CI_COMMIT_TAG} \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + --cache-from type=registry,ref=${CI_REGISTRY_IMAGE}:build-cache-dev-py${PYTHON_VERSION} \ + --provenance false \ + --push \ + --tag ${CI_REGISTRY_IMAGE}:prod-py${PYTHON_VERSION} \ + --tag ${CI_REGISTRY_IMAGE}:prod-py${PYTHON_VERSION}-${CI_COMMIT_TAG} \ + --target prod \ + .devcontainer/Dockerfile + variables: + DOCKER_TLS_CERTDIR: /certs + PYTHON_VERSION: ${PYTHON_VERSION} + SOURCE_DATE_EPOCH: 0 package-publish: needs: - release-publish