diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b54874b7e..f1fb762e4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -20,13 +20,17 @@ on: type: string description: "PHP Version" required: true + debug: + type: string + description: "PHP Debug -> Options [yes, no]" + required: false zts: type: string - description: "ZTS (Zend Thread Safety)" + description: "ZTS (Zend Thread Safety) -> Options [yes, no]" required: true ubuntu_version: type: string - description: "Ubuntu Version" + description: "Ubuntu Version -> Options [20.04, 22.04, 24.04]" required: false default: "24.04" secrets: @@ -52,30 +56,20 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push API - id: docker_build_zts - uses: docker/build-push-action@v5 - if: ${{ inputs.zts == 'yes' }} - with: - file: ./docker/Dockerfile - context: . - push: true - pull: true - platforms: linux/amd64 - target: final - tags: malusevd99/scylladb-php-driver:ubuntu-${{ inputs.ubuntu_version }}-php-${{ inputs.php }}-zts - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - PHP_VERSION=${{ inputs.php }} - PHP_ZTS=${{ inputs.zts }} - UBUNTU_VERSION=${{ inputs.ubuntu_version }} - PHP_DEBUG="yes" + - name: Extract PHP Version and ZTS + id: version + run: | + export PHP_VERSION="$(echo ${{ inputs.php }} | grep -oP '^\d+\.\d+')" + PHP_ENDING="php-$PHP_VERSION" + + [[ ${{ inputs.zts }} == "yes" ]] && PHP_ENDING="$PHP_ENDING-zts" + [[ ${{ inputs.debug }} == "yes" ]] && PHP_ENDING="$PHP_ENDING-debug" + + echo "php_ending=$PHP_ENDING" >> $GITHUB_ENV - name: Build and push API - id: docker_build_nts + id: docker_build uses: docker/build-push-action@v5 - if: ${{ inputs.zts == 'no' }} with: file: ./docker/Dockerfile context: . @@ -83,11 +77,12 @@ jobs: pull: true platforms: linux/amd64 target: final - tags: malusevd99/scylladb-php-driver:ubuntu-${{ inputs.ubuntu_version }}-php-${{ inputs.php }} + tags: malusevd99/scylladb-php-driver:ubuntu-${{ inputs.ubuntu_version }}-${{ steps.version.outputs.php }} cache-from: type=gha cache-to: type=gha,mode=max build-args: | + UBUNTU_VERSION=${{ inputs.ubuntu_version }} PHP_VERSION=${{ inputs.php }} PHP_ZTS=${{ inputs.zts }} - UBUNTU_VERSION=${{ inputs.ubuntu_version }} - PHP_DEBUG="yes" + PHP_DEBUG=${{ inputs.debug }} + PHP_MEM_SANITIZERS=${{ inputs.debug }} diff --git a/.github/workflows/test-images.yml b/.github/workflows/test-images.yml index 2d084d391..aa415509b 100644 --- a/.github/workflows/test-images.yml +++ b/.github/workflows/test-images.yml @@ -11,13 +11,15 @@ jobs: strategy: matrix: tag: ["8.1.29", "8.2.20", "8.3.8"] - zts: [yes, no] + zts: ['yes', 'no'] + debug: ['yes', 'no'] ubuntu_version: ["20.04", "22.04", "24.04"] uses: "./.github/workflows/docker-image.yml" with: php: ${{ matrix.tag }} zts: ${{ matrix.zts }} ubuntu_version: ${{ matrix.ubuntu_version }} + debug: ${{ matrix.debug }} secrets: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/CMakeLists.txt b/CMakeLists.txt index a5cfdeb93..216b1b259 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,7 @@ include(cmake/CPM.cmake) include(cmake/TargetOptimizations.cmake) include(cmake/ScyllaDBPHPLibrary.cmake) -set(PHP_SCYLLADB_VERSION_MAJOR 1) -set(PHP_SCYLLADB_VERSION_MINOR 3) -set(PHP_SCYLLADB_VERSION_PATCH 12) -set(PHP_SCYLLADB_STABILITY "devel") -set(PHP_SCYLLADB_VERSION_FULL "${PHP_SCYLLADB_VERSION_MAJOR}.${PHP_SCYLLADB_VERSION_MINOR}.${PHP_SCYLLADB_VERSION_PATCH}-${PHP_SCYLLADB_STABILITY}") -set(PHP_SCYLLADB_VERSION "${PHP_SCYLLADB_VERSION_MAJOR}.${PHP_SCYLLADB_VERSION_MINOR}.${PHP_SCYLLADB_VERSION_PATCH}-dev") +set(PHP_SCYLLADB_VERSION "1.4.0-dev") set(CMAKE_C_STANDARD 17) set(CMAKE_CXX_STANDARD 20) diff --git a/src/Core.cpp b/src/Core.cpp index 52a97204d..8be4128f1 100644 --- a/src/Core.cpp +++ b/src/Core.cpp @@ -142,8 +142,7 @@ void php_driver_define_Core() { zend_declare_class_constant_string(php_driver_core_ce, ZEND_STRL("TYPE_INET"), "inet"); - zend_declare_class_constant_string(php_driver_core_ce, ZEND_STRL("VERSION"), - PHP_DRIVER_VERSION_FULL); + zend_declare_class_constant_string(php_driver_core_ce, ZEND_STRL("VERSION"), PHP_DRIVER_VERSION); snprintf(buf, sizeof(buf), "%d.%d.%d%s", CASS_VERSION_MAJOR, CASS_VERSION_MINOR, CASS_VERSION_PATCH, diff --git a/version.h.in b/version.h.in index f193bfc09..8df52f223 100644 --- a/version.h.in +++ b/version.h.in @@ -1,9 +1,4 @@ #pragma once #define PHP_DRIVER_NAME "cassandra" -#define PHP_DRIVER_MAJOR @PHP_SCYLLADB_VERSION_MAJOR@ -#define PHP_DRIVER_MINOR @PHP_SCYLLADB_VERSION_MINOR@ -#define PHP_DRIVER_RELEASE @PHP_SCYLLADB_VERSION_PATCH@ -#define PHP_DRIVER_STABILITY "@PHP_SCYLLADB_STABILITY@" -#define PHP_DRIVER_VERSION "@PHP_SCYLLADB_VERSION@" -#define PHP_DRIVER_VERSION_FULL "@PHP_SCYLLADB_VERSION_FULL@" \ No newline at end of file +#define PHP_DRIVER_VERSION "@PHP_SCYLLADB_VERSION@" \ No newline at end of file