Skip to content

Commit

Permalink
[iss-32]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 4a1e95d
Author: joaquin.f.fernandez <[email protected]>
Date:   Thu Oct 3 14:52:14 2024 -0300

    Update file versions.

commit 0597655
Author: joaquin.f.fernandez <[email protected]>
Date:   Thu Oct 3 11:59:22 2024 -0300

    Updated gitignore.

commit 13e3d56
Author: joaquin.f.fernandez <[email protected]>
Date:   Thu Oct 3 11:59:07 2024 -0300

    Added deploy folder.
  • Loading branch information
joaquinffernandez committed Oct 4, 2024
1 parent d17f487 commit 7c01077
Show file tree
Hide file tree
Showing 14 changed files with 200 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ Makefile

# Log files
SBG.log

# Binary generated files.
sbg/test/utest/matching-test
parser/sbg-parser
sbg/test/utest/graph-test
sbg/test/utest/GraphTest
sbg/test/utest/order-test
sbg/test/utest/PrintGraphs
sbg/test/utest/scc-test
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ doc:
@mkdir -p $(ROOT)/doc/html
@mkdir -p $(ROOT)/doc/latex
doxygen sbg/SBG.doxyfile
doxygen sbg/util/UTIL.doxyfile
doxygen util/UTIL.doxyfile

test: lib-gtest $(SBG_TEST)

Expand Down
23 changes: 23 additions & 0 deletions deploy/linux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Release procedure**

- Checkout `sb-graph-release` branch.
- Create branch `release-X.X.X`.
- Merge `sb-graph-dev` -> `sb-graph-release`.
- Update `version` file to `X.X.X`.
- Run `update.sh`.
- Commit update changes with `-n`.
- Update `CHANGELOG` and `README.md` files.
- Commit changes with `-n`.
- Push branch.
- Merge pushed branch in `sb-graph-release` with `--squash`.
- Push `sb-graph-release` branch.
- Merge `sb-graph-release` in `sb-graph-dev`.

**Github Realease**

- Select Releases -> Draft a new release.
- Choose the corresponding version tag of the new release.
- Select sb-graph-release as the target branch.
- Update release title and description.
- Upload deb files.
- Publish the release.
110 changes: 110 additions & 0 deletions deploy/linux/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/bash
#===================================================================================
#
# FILE: build.sh
#
# USAGE: build.sh
#
# DESCRIPTION: Build the Linux deb package for Set Based Graph Library.
#
# PARAMETERS: ---
# OPTIONS: ---
# REQUIREMENTS: ---
# NOTES: ---
# AUTHOR: Joaquin Fernandez, [email protected]
# PROJECT: Set Based Graph Library
# VERSION: 3.0.0
#===================================================================================

LIB_NAME=sb-graph-lib

rm -rf $LIB_NAME-*.deb

cd ../../
ARCH=`uname -m`
echo "Retrieving latest from Git";
git pull

# Set library version
VER=`cat ./deploy/linux/version`

# Set OS config files.
CONTROL_FILE="control.amd64"
PACKAGE_NAME=$LIB_NAME-$VER
SYSTEM_VERSION=`lsb_release -d`
if [[ "$SYSTEM_VERSION" == *"22.04"* ]]; then
CONTROL_FILE="control.amd64.u22"
PACKAGE_NAME=$PACKAGE_NAME-u22
fi

# Set solver branch
BRANCH=`git rev-parse --abbrev-ref HEAD`

# If build from development branch, update package name to unstable.
if [ "$BRANCH" != "sb-graph-release" ]; then
PACKAGE_NAME=$PACKAGE_NAME-unstable
fi

PACKAGE_NAME=$PACKAGE_NAME.deb

echo "Building SB Graph DEB package for $ARCH version $VER";
echo "Building Binaries";
autoconf
./configure
make clean
make

echo "Creating temp folders..."
rm -rf tmp_deb
rm -rf tmp
mkdir tmp_deb
mkdir tmp
echo "Done."

echo "Export repo to temp folder..."
CHECKOUT_PATH=./tmp/
mkdir -p $CHECKOUT_PATH
git checkout-index -a -f --prefix=$CHECKOUT_PATH
echo "Done."

echo "Export tmp files to deb container..."

USER_FOLDER=usr
INSTALL_FOLDER=$USER_FOLDER/local
INCLUDE=include
LIB=lib
BIN=bin

cp -r ./deploy/linux/deb/* ./tmp_deb/
chmod 0755 tmp_deb/DEBIAN/post*
mkdir ./tmp_deb/$USER_FOLDER
mkdir ./tmp_deb/$INSTALL_FOLDER
mkdir ./tmp_deb/$INSTALL_FOLDER/$BIN
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/ast
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/eval
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/parser
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/sbg
mkdir ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/util
mkdir ./tmp_deb/$INSTALL_FOLDER/$LIB

cat ./tmp_deb/DEBIAN/$CONTROL_FILE | awk -v VERSION="$VER" '{ if(index($0,"Version:")>=1) print "Version: " VERSION ; else print $0;}' > ./tmp_deb/DEBIAN/control
rm ./tmp_deb/DEBIAN/$CONTROL_FILE

cp bin/sbg-eval ./tmp_deb/$INSTALL_FOLDER/$BIN
cp bin/sbg-parser ./tmp_deb/$INSTALL_FOLDER/$BIN
cp lib/libsbgraph.a ./tmp_deb/$INSTALL_FOLDER/$LIB
cp -r ./tmp/ast/*.hpp ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/ast
cp -r ./tmp/eval/*.hpp ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/eval
cp -r ./tmp/parser/*.hpp ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/parser
cp -r ./tmp/sbg/*.hpp ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/sbg
cp -r ./tmp/util/*.hpp ./tmp_deb/$INSTALL_FOLDER/$INCLUDE/sb-graph/util

chmod 0644 `find tmp_deb/ -iname *.hpp`
chmod 0755 `find tmp_deb/ -type d`
fakeroot dpkg -b tmp_deb $LIB_NAME.deb
mv $LIB_NAME.deb ./deploy/linux/$PACKAGE_NAME
rm -rf tmp_deb
rm -rf tmp
cd deploy/linux
9 changes: 9 additions & 0 deletions deploy/linux/deb/DEBIAN/control.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: sb-graph-lib
Version:
Architecture: amd64
Maintainer: Denise Marzorati <[email protected]>
Installed-Size: 801758
Section: science
Priority: extra
Homepage: https://github.com/CIFASIS/sb-graph
Description: Set Based Graph library.
9 changes: 9 additions & 0 deletions deploy/linux/deb/DEBIAN/control.amd64.u22
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: sb-graph-lib
Version:
Architecture: amd64
Maintainer: Denise Marzorati <[email protected]>
Installed-Size: 801758
Section: science
Priority: extra
Homepage: https://github.com/CIFASIS/sb-graph
Description: Set Based Graph library.
2 changes: 2 additions & 0 deletions deploy/linux/deb/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
# End automatically added section
3 changes: 3 additions & 0 deletions deploy/linux/deb/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# Automatically added by dh_installmenu
# End automatically added section
29 changes: 29 additions & 0 deletions deploy/linux/update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#===================================================================================
#
# FILE: update-version.sh
#
# USAGE: update-version.sh
#
# DESCRIPTION: Helper script to update version info in all project related files.
#
# PARAMETERS: ---
# OPTIONS: ---
# REQUIREMENTS: ---
# NOTES: ---
# AUTHOR: Joaquin Fernandez, [email protected]
# PROJECT: Set Based Graph Library
#===================================================================================

VER=`cat ./version`

# Update deploy files.
sed -i "s/VERSION:.*/VERSION: $VER/" ./build.sh

# Update doxyfiles.
sed -i "s/PROJECT_NUMBER =.*/PROJECT_NUMBER = $VER/" ../../sbg/SBG.doxyfile
sed -i "s/PROJECT_NUMBER =.*/PROJECT_NUMBER = $VER/" ../../util/UTIL.doxyfile

# Update main bynary files version.
sed -i "s/SBG library v.*/SBG library v$VER\" << std::endl;/" ../../parser/main.cpp
sed -i "s/SBG library v.*/SBG library v$VER\" << std::endl;/" ../../eval/main.cpp
1 change: 1 addition & 0 deletions deploy/linux/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0
2 changes: 1 addition & 1 deletion eval/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void usage()

void version()
{
std::cout << "SBG library v3.0\n";
std::cout << "SBG library v3.0.0" << std::endl;
std::cout << "License GPLv3+: GNU GPL version 3 or later"
<< " <http://gnu.org/licenses/gpl.html>\n";
std::cout << "This is free software: you are free to change and redistribute"
Expand Down
2 changes: 1 addition & 1 deletion parser/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void usage()

void version()
{
std::cout << "SBG library v3.0\n";
std::cout << "SBG library v3.0.0" << std::endl;
std::cout << "License GPLv3+: GNU GPL version 3 or later"
<< " <http://gnu.org/licenses/gpl.html>\n";
std::cout << "This is free software: you are free to change and redistribute"
Expand Down
2 changes: 1 addition & 1 deletion sbg/SBG.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = Set-Based Graph Library
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.0.0
PROJECT_NUMBER = 3.0.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion util/UTIL.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Util Library"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.0.0
PROJECT_NUMBER = 3.0.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down

0 comments on commit 7c01077

Please sign in to comment.