Skip to content

Commit

Permalink
Merge pull request #593 from cyclus/deb-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gonuke authored Apr 7, 2024
2 parents 24bb0e3 + 73c2dc8 commit d51aa95
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 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"]'
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cycamore Change Log
**Added:**

* Downstream testing in CI workflows (#573, #580, #582, #583)
* GitHub workflow for publishing images on release (#573, #582, #583)
* GitHub workflow for publishing images and debian packages on release (#573, #582, #583, #593)
* GitHub workflows for building/testing on a PR and push to `main` (#549, #564, #573, #582, #583, #590)
* Add functionality for random behavior on the size (#550) and frequency (#565) of a sink
* GitHub workflow to check that the CHANGELOG has been updated (#562)
Expand Down
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 /cycamore/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 d51aa95

Please sign in to comment.