Skip to content

Commit

Permalink
Merge pull request #32 from HyperInspire/feature/ci
Browse files Browse the repository at this point in the history
AdD auto-build ci
  • Loading branch information
tunmx authored May 7, 2024
2 parents 3f034b6 + 4441f3d commit cd83d50
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/built_release_from_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ jobs:

# Step 4: Build projects using Docker Compose
- name: Build SDKs with Docker Compose
run: docker-compose up
run: |
docker-compose up
ls build
# Step 5: Zip each SDK directory with the version number
- name: Zip SDK Files
run: |
zip -r inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-armhf/
zip -r inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-rv1109rv1126-armhf/
zip -r inspireface-linux-x86-ubuntu18-${{ env.VERSION }}.zip build/inspireface-linux-x86-ubuntu18/
zip -r inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-armhf-${{ env.VERSION }}/
zip -r inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}/
zip -r inspireface-linux-x86-ubuntu18-${{ env.VERSION }}.zip build/inspireface-linux-x86-ubuntu18-${{ env.VERSION }}/
# Step 6: Upload the zipped SDK files for the next job
- name: Upload SDK Artifacts
Expand Down
18 changes: 12 additions & 6 deletions command/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ move_install_files() {
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
}

if [ -n "$VERSION" ]; then
TAG="-$VERSION"
else
TAG=""
fi

# Detect the operating system
OS_NAME=$(uname)
BUILD_DIR="build"
Expand All @@ -34,32 +40,32 @@ SCRIPT_DIR=$(pwd) # Project dir
case "$OS_NAME" in
Darwin)
# macOS system
BUILD_DIR="${BUILD_DIR}/inspireface-macos"
BUILD_DIR="${BUILD_DIR}/inspireface-macos${TAG}"
;;
Linux)
# Linux system, further identify the distribution if necessary
if [ -f /etc/os-release ]; then
. /etc/os-release
case "$ID" in
ubuntu)
BUILD_DIR="${BUILD_DIR}/inspireface-linux-ubuntu"
BUILD_DIR="${BUILD_DIR}/inspireface-linux-ubuntu${TAG}"
;;
centos)
BUILD_DIR="${BUILD_DIR}/inspireface-linux-centos"
BUILD_DIR="${BUILD_DIR}/inspireface-linux-centos${TAG}"
;;
*)
# If an unknown Linux distribution, default to generic 'linux'
BUILD_DIR="${BUILD_DIR}/inspireface-linux"
BUILD_DIR="${BUILD_DIR}/inspireface-linux${TAG}"
;;
esac
else
# If unable to detect Linux distribution, default to 'linux'
BUILD_DIR="${BUILD_DIR}/inspireface-linux"
BUILD_DIR="${BUILD_DIR}/inspireface-linux${TAG}"
fi
;;
*)
# If OS is not recognized, default to 'generic'
BUILD_DIR="${BUILD_DIR}/inspireface-generic"
BUILD_DIR="${BUILD_DIR}/inspireface-generic${TAG}"
;;
esac

Expand Down
8 changes: 7 additions & 1 deletion command/build_cross_armv7_armhf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ move_install_files() {
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
}

if [ -n "$VERSION" ]; then
TAG="-$VERSION"
else
TAG=""
fi

SCRIPT_DIR=$(pwd) # Project dir
BUILD_FOLDER_PATH="build/inspireface-linux-armv7-armhf"
BUILD_FOLDER_PATH="build/inspireface-linux-armv7-armhf${TAG}"

mkdir -p ${BUILD_FOLDER_PATH}
# shellcheck disable=SC2164
Expand Down
8 changes: 7 additions & 1 deletion command/build_cross_rv1109rv1126_armhf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ move_install_files() {
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
}

if [ -n "$VERSION" ]; then
TAG="-$VERSION"
else
TAG=""
fi

SCRIPT_DIR=$(pwd) # Project dir
BUILD_FOLDER_PATH="build/inspireface-linux-armv7-rv1109rv1126-armhf"
BUILD_FOLDER_PATH="build/inspireface-linux-armv7-rv1109rv1126-armhf${TAG}"

mkdir -p ${BUILD_FOLDER_PATH}
# shellcheck disable=SC2164
Expand Down
8 changes: 7 additions & 1 deletion command/build_linux_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ move_install_files() {
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
}

BUILD_FOLDER_PATH="build/inspireface-linux-cuda"
if [ -n "$VERSION" ]; then
TAG="-$VERSION"
else
TAG=""
fi

BUILD_FOLDER_PATH="build/inspireface-linux-cuda${TAG}"
SCRIPT_DIR=$(pwd) # Project dir

mkdir -p ${BUILD_FOLDER_PATH}
Expand Down
8 changes: 7 additions & 1 deletion command/build_linux_ubuntu18.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ move_install_files() {
echo "Files from 'install' moved to $root_dir, and 'install' directory deleted."
}

BUILD_FOLDER_PATH="build/inspireface-linux-x86-ubuntu18/"
if [ -n "$VERSION" ]; then
TAG="-$VERSION"
else
TAG=""
fi

BUILD_FOLDER_PATH="build/inspireface-linux-x86-ubuntu18/${TAG}"
SCRIPT_DIR=$(pwd) # Project dir

mkdir -p ${BUILD_FOLDER_PATH}
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ services:
build:
context: .
dockerfile: docker/Dockerfile.ubuntu18 # Use the Ubuntu18.04
environment:
- VERSION=${VERSION}
working_dir: /workspace
volumes:
- .:/workspace # Mount the project root directory to the container
Expand All @@ -12,6 +14,8 @@ services:
build:
context: .
dockerfile: docker/Dockerfile.arm-linux-gnueabihf # Use the arm-linux-gnueabihf tool chain
environment:
- VERSION=${VERSION}
working_dir: /workspace
volumes:
- .:/workspace # Mount the project root directory to the container
Expand All @@ -20,6 +24,8 @@ services:
build:
context: .
dockerfile: docker/Dockerfile.arm-linux-gnueabihf # Use the arm-linux-gnueabihf tool chain
environment:
- VERSION=${VERSION}
working_dir: /workspace
volumes:
- .:/workspace # Mount the project root directory to the container
Expand Down

0 comments on commit cd83d50

Please sign in to comment.