diff --git a/.github/workflows/build-cibw.yml b/.github/workflows/build-cibw.yml index e2b8919cb..018d22a60 100644 --- a/.github/workflows/build-cibw.yml +++ b/.github/workflows/build-cibw.yml @@ -24,8 +24,10 @@ jobs: with: python-version: ${{ matrix.python_version }} - - name: Set Nightly Flag - run: echo "NIGHTLY=1" >> $GITHUB_ENV + - name: Set Develop Flag + run: | + echo "DEVELOP=1" >> $GITHUB_ENV + echo "COMMIT_HASH=$(git rev-parse --short=7 "$GITHUB_SHA")" >> $GITHUB_ENV - name: Install Dependencies run: | @@ -41,7 +43,7 @@ jobs: CIBW_BUILD: cp${{ matrix.cibw_python_version }}-${{ matrix.platform_id }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }} CIBW_ARCHS: all - CIBW_ENVIRONMENT_PASS_LINUX: NIGHTLY + CIBW_ENVIRONMENT_PASS_LINUX: DEVELOP COMMIT_HASH CIBW_BUILD_FRONTEND: "build" CIBW_BEFORE_ALL: bash {project}/build_tools/wheels/cibw_before_all.sh ${{ matrix.python_version }} {project} diff --git a/CMakeLists.txt b/CMakeLists.txt index e2bc9da5e..f1070bfc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,10 +10,9 @@ set (GTSAM_VERSION_PATCH 0) set (GTSAM_PRERELEASE_VERSION "a0") math (EXPR GTSAM_VERSION_NUMERIC "10000 * ${GTSAM_VERSION_MAJOR} + 100 * ${GTSAM_VERSION_MINOR} + ${GTSAM_VERSION_PATCH}") -if (DEFINED ENV{NIGHTLY}) - string(TIMESTAMP NOW "%Y.%m.%d.%H.%M") - set (GTSAM_VERSION_STRING "${NOW}") - set (SETUP_NAME "gtsam-nightly") +if (DEFINED ENV{DEVELOP}) + set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}${GTSAM_PRERELEASE_VERSION}.$ENV{COMMIT_HASH}") + set (SETUP_NAME "gtsam-develop") elseif ("${GTSAM_PRERELEASE_VERSION}" STREQUAL "") set (GTSAM_VERSION_STRING "${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH}") set (SETUP_NAME "gtsam") diff --git a/build_tools/wheels/build_wheels.sh b/build_tools/wheels/build_wheels.sh index b8f0750a3..a8cbb93de 100644 --- a/build_tools/wheels/build_wheels.sh +++ b/build_tools/wheels/build_wheels.sh @@ -4,4 +4,4 @@ set -e set -x python -m pip install cibuildwheel -python -m cibuildwheel build/python --output-dir wheelhouse \ No newline at end of file +python -m cibuildwheel build/python --output-dir wheelhouse diff --git a/build_tools/wheels/cibw_before_all.sh b/build_tools/wheels/cibw_before_all.sh index 5b0e71940..2659ff1b6 100644 --- a/build_tools/wheels/cibw_before_all.sh +++ b/build_tools/wheels/cibw_before_all.sh @@ -1,5 +1,8 @@ #!/bin/bash +# This script is invoked prior to building the wheels with cibuildwheel. It is used in the build-cibw.yml workflow in .github/workflows. +# It installs the necessary dependencies and builds the wrapper module for the specified Python version. + set -e set -x