diff --git a/.forgejo/workflows/package.yaml b/.forgejo/workflows/package.yaml deleted file mode 100644 index b090971..0000000 --- a/.forgejo/workflows/package.yaml +++ /dev/null @@ -1,76 +0,0 @@ ---- -name: Package - -on: - push: - tags: - - "*" - -jobs: - package: - strategy: - matrix: - platform: - - dpkg: arm64 - runs-on: debian-12-arm64 - - runs-on: debian-12-arm64 - - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - - name: Install dependencies - run: | - apt update - apt install -y \ - build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest - - - uses: actions/checkout@v4 - - - name: configure - run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCPACK_DEBIAN_PACKAGE_RELEASE=compair1 - - - name: build - run: cmake --build build --config Release -j2 - - - name: test - working-directory: build - run: ctest -C Release - - - name: build deb - working-directory: build - run: cpack --build . -G DEB - - - name: get tag - run: | - echo "TAG=$(git describe --abbrev=0 --tags)-compair1" >>$GITHUB_ENV - - # https://forgejo.org/docs/latest/user/packages/debian/#publish-a-package - - name: push deb to apt repository - env: - REPO: ${{ github.repository }} - run: | - url="${GITHUB_SERVER_URL}/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload" - urlBotball="${GITHUB_SERVER_URL}/api/packages/Botball/debian/pool/bookworm/wombatos/upload" - - echo "api url: $url" - debfile="_packages/libcreate_${TAG}_${{ matrix.platform.dpkg }}.deb" - - echo "uploading file: $debfile" - curl --fail-with-body \ - -X PUT \ - --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ - --upload-file "$debfile" \ - "$url" - - echo "uploading file for WombatOs: $debfile" - curl --fail-with-body \ - -X PUT \ - --user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \ - --upload-file "$debfile" \ - "$urlBotball" - - echo "final url: ${GITHUB_SERVER_URL}/${{ github.repository_owner }}/-/packages/debian/libcreate/${TAG}" - echo "final url for Botball: ${GITHUB_SERVER_URL}/Botball/-/packages/debian/libcreate/${TAG}" diff --git a/.forgejo/workflows/test.yaml b/.forgejo/workflows/test.yaml deleted file mode 100644 index 2b55f1a..0000000 --- a/.forgejo/workflows/test.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Build and test - -on: - push: - branches: - - master - pull_request: - -env: - BUILD_TYPE: Release - -jobs: - test: - runs-on: debian-12 - - steps: - - name: Install dependencies - run: | - apt update - apt install -y \ - build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest - - - uses: actions/checkout@v4 - - - name: Configure CMake - run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} - - - name: Build - run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} - - - name: Test - working-directory: ${{ github.workspace }}/build - run: ctest -C ${{ env.BUILD_TYPE }} diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 0000000..113c7bb --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,41 @@ +name: Package + +on: + push: + tags: + - "*" + +jobs: + package: + runs-on: ubuntu-24.04 + strategy: + matrix: + platform: [linux/arm64/v8] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + + - name: Prepare container + run: docker buildx build -f ci/Dockerfile . -t libcreate --platform ${{ matrix.platform }} --load + - name: Build + run: docker run --platform ${{ matrix.platform }} -v ./output:/libcreate/_packages libcreate + - name: Push deb to compREP + uses: cpina/github-action-push-to-another-repository@main + env: + SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} + with: + source-directory: "output/" + target-directory: "debs/complib/" + destination-github-username: "F-WuTS" + destination-repository-name: "compREP" + target-branch: master diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..986dc29 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: Build and test + +on: + push: + branches: ["master"] + pull_request: + +env: + BUILD_TYPE: Release + +jobs: + test: + runs-on: ubuntu-24.04 + + steps: + - name: Install dependencies + run: | + sudo apt install build-essential cmake git libboost-system-dev libboost-thread-dev file libgtest-dev googletest + + - uses: actions/checkout@v4 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-Werror" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 28408a6..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# CMake/CPack -build/ -_packages/ diff --git a/CMakeLists.txt b/CMakeLists.txt index e39cf16..007b56b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ project( VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH} ) -add_compile_options(-Wall -Wextra -Wpedantic -Werror) +add_compile_options(-Wall -Wextra -Wpedantic) set(PACKAGE_VERSION ${TAG_VERSION_MAJOR}.${TAG_VERSION_MINOR}.${TAG_VERSION_PATCH}) diff --git a/README.md b/README.md index b1eb336..fa1232c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ C++ library for interfacing with iRobot's Create 1 and 2 as well as most models - [`V_1`](https://drive.google.com/file/d/0B9O4b91VYXMdUHlqNklDU09NU0k/view?usp=sharing&resourcekey=0-KxMpRPBMsGAj7eSYC_9ewA) (Roomba 400 series ) - [`V_2`](https://drive.google.com/file/d/0B9O4b91VYXMdMmFPMVNDUEZ6d0U/view?usp=sharing&resourcekey=0-bqKH8xhtWdYtTik_LLWo9Q) (Create 1, Roomba 500 series) - [`V_3`](https://drive.google.com/file/d/0B9O4b91VYXMdSVk4amw1N09mQ3c/view?usp=sharing&resourcekey=0-rKvug2IzC7nj4zV31EJtww) (Create 2, Roomba 600-800 series) -* Author: [Jacob Perron](http://jacobperron.ca) ([Autonomy Lab](https://autonomy.cs.sfu.ca), [Simon Fraser University](http://www.sfu.ca)) +* Author: [Jacob Perron](http://jacobperron.ca) ([Autonomy Lab](http://autonomylab.org), [Simon Fraser University](http://www.sfu.ca)) * Contributors: [Mani Monajjemi](http:mani.im), [Ben Wolsieffer](https://github.com/lopsided98), [Josh Gadeken](https://github.com/process1183) ## Build Status ## diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..3274bbe --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,14 @@ +FROM debian:bookworm + +RUN apt update && \ + apt install -y \ + build-essential cmake git file \ + libboost-system-dev libboost-thread-dev \ + libgtest-dev googletest && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /libcreate +COPY . . + +WORKDIR /libcreate/build +ENTRYPOINT ["/bin/bash", "/libcreate/ci/entrypoint.sh"] diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh new file mode 100755 index 0000000..c371918 --- /dev/null +++ b/ci/entrypoint.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o errexit +set -o nounset +set -o pipefail + +cmake -B /libcreate/build -S /libcreate -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS='-Werror' +cmake --build /libcreate/build --config Release +ctest -C Release --output-on-failure +cpack --build /libcreate/build -G DEB \ No newline at end of file diff --git a/cmake/Packing.cmake b/cmake/Packing.cmake index 58d81b8..53291fd 100644 --- a/cmake/Packing.cmake +++ b/cmake/Packing.cmake @@ -13,6 +13,9 @@ set(CPACK_VERBATIM_VARIABLES YES) set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages") +# https://unix.stackexchange.com/a/11552/254512 +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${CPACK_PACKAGE_NAME}") + set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) @@ -38,4 +41,6 @@ set( # you'll get some-application_0.9.2_amd64.deb (note the underscores too) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +message(STATUS "Components to pack: ${CPACK_COMPONENTS_ALL}") + include(CPack) \ No newline at end of file diff --git a/cmake/Versioning.cmake b/cmake/Versioning.cmake index d659c5c..7665011 100644 --- a/cmake/Versioning.cmake +++ b/cmake/Versioning.cmake @@ -8,7 +8,7 @@ if(GIT_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(DEFINED ENV{GITHUB_REF} AND ENV{GITHUB_REF_TYPE} EQUAL "tag") + if(DEFINED ENV{GITHUB_REF}) set(TAG_VERSION $ENV{GITHUB_REF}) message(STATUS "Extracted version from GITHUB_REF") endif() diff --git a/output/libcreate_3.1.4_arm64.deb b/output/libcreate_3.1.4_arm64.deb new file mode 100644 index 0000000..d9c0cfb Binary files /dev/null and b/output/libcreate_3.1.4_arm64.deb differ diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..e69de29