-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix invalid version string for the bennu .deb - Ensure .deb has a properly formatted version - Set version for everything in cmake to 6.0.0 (not intended to change, just a placeholder) - Add GitHub URL to package metadata - Fix architecture variable - Fix warning with old tags command * refactoring CI for bennu C++ build * apply version fix to pybennu deb as well * WIP on CI * more CI tweaks * sudo is needed * split into separate steps, upload artifacts earlier
- Loading branch information
1 parent
f705575
commit 4bd939d
Showing
6 changed files
with
80 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
name: C/C++ CI | ||
name: Build and test C++ bennu and deb for pybennu | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: checkout the repo | ||
uses: actions/checkout@v3 | ||
- name: get tags | ||
run: git fetch --tags | ||
uses: actions/checkout@v4 | ||
- name: Install build dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends -y build-essential cmake g++ gcc libasio-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libfreetype6-dev libssl-dev libzmq5-dev python3-pip python3-wheel | ||
sudo gem install fpm | ||
- name: configure bennu | ||
run: | | ||
sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential cmake g++ gcc libasio-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libfreetype6-dev libssl-dev libzmq5-dev | ||
mkdir build | ||
cd build/ | ||
cmake ../ | ||
|
@@ -53,29 +57,40 @@ jobs: | |
grep "load-power:999" probe.out | ||
echo -e "help\nexit" | bennu-brash >brash.out 2>&1 | ||
grep "SCEPTRE Field-Device" brash.out | ||
- name: package bennu | ||
bennu-watcherd --help | ||
bennu-simulink-provider --help | ||
bennu-field-deviced --help | ||
bennu-simulink-provider-helics --help | ||
- name: build deb for bennu | ||
run: | | ||
cd build/ | ||
sudo make package | ||
- name: package pybennu | ||
cp ./*.deb ../bennu.deb | ||
- name: build deb for pybennu | ||
run: | | ||
sudo apt-get install --no-install-recommends -y python3-pip python3-wheel | ||
sudo gem install fpm | ||
cd src/pybennu | ||
make deb > deb.log 2>&1 | ||
#make dist > dist.log 2>&1 | ||
- name: archive artifacts | ||
uses: actions/upload-artifact@v3 | ||
sudo make deb | ||
cp ./dist/*.deb ../../pybennu.deb | ||
- name: archive deb artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bennu artifacts | ||
name: bennu-deb-artifacts | ||
if-no-files-found: error | ||
path: | | ||
*.log | ||
build/*.deb | ||
src/pybennu/dist/* | ||
- name: release bennu and pybennu | ||
bennu.deb | ||
pybennu.deb | ||
- name: deb file metadata | ||
run: | | ||
cp build/*.deb build/bennu.deb | ||
cp src/pybennu/dist/*.deb src/pybennu/dist/pybennu.deb | ||
curl -F package=@build/bennu.deb https://${{ secrets.GEMFURY }}@push.fury.io/sceptre/ | ||
curl -F package=@src/pybennu/dist/pybennu.deb https://${{ secrets.GEMFURY }}@push.fury.io/sceptre/ | ||
dpkg-deb --info ./bennu.deb | ||
dpkg-deb --info ./pybennu.deb | ||
- name: check bennu deb installs | ||
run: | | ||
sudo dpkg -i bennu.deb | ||
- name: check pybennu deb installs | ||
run: | | ||
sudo dpkg -i pybennu.deb | ||
- name: release debs to apt repo | ||
if: (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true) || (github.event_name == 'push' && github.ref == 'refs/heads/main') | ||
run: | | ||
curl -F [email protected] https://${{ secrets.GEMFURY }}@push.fury.io/sceptre/ | ||
curl -F [email protected] https://${{ secrets.GEMFURY }}@push.fury.io/sceptre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Generate deb package | ||
# CPack DEB documentation: https://cmake.org/cmake/help/latest/cpack_gen/deb.html | ||
# Debian archive description: https://www.debian.org/doc/debian-policy/ch-archive.html | ||
# Debian archive metadata: https://www.debian.org/doc/debian-policy/ch-controlfields.html | ||
|
||
string(TIMESTAMP timestamp "%Y%m%d_%H-%M-%S") | ||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_STRIP_FILES TRUE) | ||
set(CPACK_DEBIAN_PACKAGE_NAME bennu) | ||
set(CPACK_DEBIAN_PACKAGE_VERSION ${bennu_TAG_HASH}) | ||
set(CPACK_DEBIAN_PACKAGE_ARCHITECHTURE amd64) | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sandia National Laboratories <[email protected]") | ||
|
||
# "This variable may contain only alphanumerics (A-Za-z0-9) and the characters . + - ~ (full stop, plus, hyphen, tilde) and should start with a digit. If CPACK_DEBIAN_PACKAGE_RELEASE is not set then hyphens are not allowed." | ||
# NOTE: "bennu_VERSION_WITH_COMMIT" gets set in the top-level CMakeLists.txt file | ||
set(CPACK_DEBIAN_PACKAGE_VERSION ${bennu_VERSION_WITH_COMMIT}) | ||
|
||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64) | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Sandia National Laboratories <[email protected]>") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libasio-dev, libboost-date-time-dev, libboost-filesystem-dev, libboost-program-options-dev, libboost-system-dev") | ||
set(CPACK_DEBIAN_PACKAGE_SECTION misc) | ||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "SCEPTRE ICS Modeling and Simulation Package") | ||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION}) | ||
set(CPACK_PACKAGE_FILE_NAME "bennu-${CPACK_DEBIAN_PACKAGE_VERSION}_amd64_${timestamp}") | ||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CMAKE_PROJECT_HOMEPAGE_URL}) | ||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters