diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index d94f443126..d116602bdb 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -11,7 +11,7 @@ jobs: build-and-test-for-release: runs-on: ubuntu-latest permissions: - contents: read + contents: write packages: write strategy: @@ -58,6 +58,7 @@ jobs: cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:ci-layer-cache file: docker/Dockerfile push: true + target: cyclus tags: | ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:${{ env.version_tag }} ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:${{ env.stable_tag }} @@ -65,3 +66,22 @@ jobs: pkg_mgr=${{ matrix.pkg_mgr }} ubuntu_version=${{ matrix.ubuntu_versions }} + - name: Make Debian Package + if: matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04' + uses: docker/build-push-action@v5 + with: + cache-from: type=registry,ref=ghcr.io/cyclus/cyclus_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cyclus:ci-layer-cache + file: docker/Dockerfile + target: deb-package + outputs: type=local,dest=. + build-args: | + pkg_mgr=${{ matrix.pkg_mgr }} + ubuntu_version=${{ matrix.ubuntu_versions }} + + - name: Upload .deb to release + if: github.event_name == 'release' && matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04' + uses: alexellis/upload-assets@0.4.0 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["cyclus*.deb"]' diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0ac09c7733..111bc6b979 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,7 +17,7 @@ Since last release will fail unless update-alternatives has been used to point python at the correct python3 version (#1558) * build and test are now fown on githubAction in place or CircleCI (#1569) -* Have separate workflows for testing, publishing dependency images, and publishing release images (#1597, #1602, #1606, #1609, #1629, #1633, #1637, #1668, #1672) +* Have separate workflows for testing, publishing dependency images, and publishing release images (#1597, #1602, #1606, #1609, #1629, #1633, #1637, #1668, #1672, #1676) * Add Ubuntu 20.04 to the list of supported platforms (#1605, #1608) * Add random number generator (Mersenne Twister 19937, from boost) and the ability to set the seed in the simulation control block (#1599, #1677) * Added code coverage reporting to GitHub workflows (#1616, #1679) @@ -52,6 +52,7 @@ Since last release * Resolve segmentation faults when using cyclus via Python (#1666) * Resolve pytest warnings related to invalid escape sequences (#1684) * Fix how Env::GetInstallPath() finds the location of the cyclus installation (#1689) +* Fix Debian package generation (#1676) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc833c9696..12e87a63e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -483,17 +483,14 @@ IF(NOT CYCLUS_DOC_ONLY) # Version SET(CPACK_PACKAGE_VERSION_MAJOR "1") - SET(CPACK_PACKAGE_VERSION_MINOR "4") - SET(CPACK_PACKAGE_VERSION_PATCH "0") + SET(CPACK_PACKAGE_VERSION_MINOR "5") + SET(CPACK_PACKAGE_VERSION_PATCH "5") # Dependencies - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libtcmalloc-minimal4 (>= 2.1)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-filesystem-dev (>= 1.54.0)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-program-options-dev (>= 1.54.0)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libboost-serialization-dev (>= 1.54.0)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libhdf5-dev (>= 1.8.11)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxml++2.6-dev (>= 2.6.0)") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, coinor-libcbc-dev (>= 2.8.7)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-all-dev (>= 1.71.0)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libhdf5-dev (>= 1.10.4)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxml++2.6-dev (>= 2.40.1)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, coinor-libcbc-dev (>= 2.10.3)") MESSAGE("CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}") # Names @@ -502,13 +499,6 @@ IF(NOT CYCLUS_DOC_ONLY) SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}.${CPACK_PACKAGE_VERSION_MINOR}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}.${CPACK_PACKAGE_VERSION_PATCH}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${CPACK_PACKAGE_VERSION_MINOR}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${CPACK_PACKAGE_VERSION_PATCH}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_HASH_NAME}") - SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_${CPACK_SYSTEM_NAME}") - # Configuration SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "1") SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) diff --git a/cmake/SetupPyInstall.cmake.in b/cmake/SetupPyInstall.cmake.in index ae8eef25b5..b99dda7b01 100644 --- a/cmake/SetupPyInstall.cmake.in +++ b/cmake/SetupPyInstall.cmake.in @@ -9,6 +9,7 @@ message("-- Python installer:") message(" PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") message(" CYCLUS_CORE_VERSION: $ENV{CYCLUS_CORE_VERSION}") message(" CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +set(CMAKE_CURRENT_BINARY_DIR @CMAKE_CURRENT_BINARY_DIR@) message(" CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}") execute_process(COMMAND ${PYTHON_EXECUTABLE} -m site --user-site WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} diff --git a/cyclus/CMakeLists.txt b/cyclus/CMakeLists.txt index 02356d9d95..6ec27ef90d 100644 --- a/cyclus/CMakeLists.txt +++ b/cyclus/CMakeLists.txt @@ -43,3 +43,5 @@ foreach(file ${CYCLUS_CYTHON_FILES}) install(TARGETS ${targ} LIBRARY DESTINATION "${PYTHON_SITE_PACKAGES}/cyclus") endforeach() +FILE(GLOB CYCLUS_PYTHON_FILES "${CYCLUS_PYSOURCE_DIR}/*.py") +INSTALL(FILES ${CYCLUS_PYTHON_FILES} DESTINATION "${PYTHON_SITE_PACKAGES}/cyclus") diff --git a/docker/Dockerfile b/docker/Dockerfile index 02c61734f2..44bb593f58 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -154,6 +154,13 @@ RUN python install.py -j ${make_cores} --build-type=Release --core-version 99999 ENV PATH /root/.local/bin:$PATH ENV LD_LIBRARY_PATH /root/.local/lib:/root/.local/lib/cyclus +FROM cyclus as deb-generation +WORKDIR /cyclus/build +RUN make package + +FROM scratch as deb-package +COPY --from=deb-generation /cyclus/build/cyclus*.deb / + FROM cyclus as cyclus-test RUN cyclus_unit_tests