Skip to content

Commit

Permalink
fix debian package generation process and add to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibbelink committed Apr 4, 2024
1 parent 24bb0e3 commit 611a2d0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build-and-test-for-release:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write

strategy:
Expand Down Expand Up @@ -57,6 +57,7 @@ jobs:
with:
cache-from: type=registry,ref=ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:ci-layer-cache
file: docker/Dockerfile
target: cycamore
push: true
tags: |
ghcr.io/cyclus/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore:${{ env.version_tag }}
Expand All @@ -65,3 +66,24 @@ jobs:
pkg_mgr=${{ matrix.pkg_mgr }}
ubuntu_version=${{ matrix.ubuntu_versions }}
cyclus_tag=stable
- 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/cycamore_${{ matrix.ubuntu_versions }}_${{ matrix.pkg_mgr }}/cycamore: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 }}
cyclus_tag=stable
- name: Upload .deb to release
if: github.event_name == 'release' && matrix.pkg_mgr == 'apt' && matrix.ubuntu_versions == '22.04'
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["cycamore*.deb"]'
9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ IF(NOT CYCLUS_DOC_ONLY)
SET(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_PROJECT_VERSION_PATCH}")

# Dependencies
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "cyclus (>= 1.4.0)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "cyclus (>= 1.5.5)")
MESSAGE("CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}")

# Names
Expand All @@ -358,13 +358,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)
Expand Down
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ WORKDIR /cycamore

RUN python install.py -j ${make_cores} --build-type=Release

FROM cycamore as deb-generation
WORKDIR /cyclus/build
RUN make package

FROM scratch as deb-package
COPY --from=deb-generation /cycamore/build/cycamore*.deb /

FROM cycamore as cycamore-test
RUN cycamore_unit_tests

Expand Down

0 comments on commit 611a2d0

Please sign in to comment.