From 647b48dafb556133e9776815dda1597b5b3e060b Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 2 Apr 2024 09:20:03 +0200 Subject: [PATCH 1/8] ci: don't push deprecated images --- .github/workflows/build-push.yml | 57 -------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/build-push.yml diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml deleted file mode 100644 index cd567e6f6..000000000 --- a/.github/workflows/build-push.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Build and Push - -# Run workflow on pushes to main branch or by manual dispatch -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build-publish-proto-dependencies-focal-fossa: - name: Build and publish proto dependencies image on ubuntu 20.04 - uses: aica-technology/.github/.github/workflows/build-push-multi-arch.yml@v0.1 - with: - image_name: ${{ github.repository }}/proto-dependencies - image_tags: 20.04 - dockerfile_path: Dockerfile.proto - platforms: linux/amd64 - build_flags: '--build-arg BASE_TAG=20.04' - secrets: - token: ${{ secrets.GITHUB_TOKEN }} - - build-publish-proto-dependencies-jammy-jellyfish: - name: Build and publish proto dependencies image on ubuntu 22.04 - uses: aica-technology/.github/.github/workflows/build-push-multi-arch.yml@v0.1 - with: - image_name: ${{ github.repository }}/proto-dependencies - image_tags: 22.04,latest - platforms: linux/amd64,linux/arm64 - dockerfile_path: Dockerfile.proto - build_flags: '--build-arg BASE_TAG=22.04' - secrets: - token: ${{ secrets.GITHUB_TOKEN }} - - build-publish-development-dependencies-focal-fossa: - needs: build-publish-proto-dependencies-focal-fossa - uses: aica-technology/.github/.github/workflows/build-push-multi-arch.yml@v0.1 - with: - image_name: ${{ github.repository }}/development-dependencies - image_tags: 20.04 - platforms: linux/amd64 - dockerfile_path: Dockerfile.base - build_flags: '--build-arg BASE_TAG=20.04' - secrets: - token: ${{ secrets.GITHUB_TOKEN }} - - build-publish-development-dependencies-jammy-jellyfish: - needs: build-publish-proto-dependencies-jammy-jellyfish - uses: aica-technology/.github/.github/workflows/build-push-multi-arch.yml@v0.1 - with: - image_name: ${{ github.repository }}/development-dependencies - image_tags: 22.04,latest - platforms: linux/amd64,linux/arm64 - dockerfile_path: Dockerfile.base - build_flags: '--build-arg BASE_TAG=22.04' - secrets: - token: ${{ secrets.GITHUB_TOKEN }} From 1df66db5102e56aca2aae0eafc0cd58bf4f7150e Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 2 Apr 2024 09:20:18 +0200 Subject: [PATCH 2/8] ci: check changelog and version --- .github/workflows/build-test.yml | 64 +++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 5b66b291a..4cf0d5681 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -4,40 +4,70 @@ on: push: branches: - main - - develop pull_request: workflow_dispatch: jobs: - check-contribution: - name: Check if changelog and version have been updated + check-changelog: + name: Check if changelog has been updated runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Check contributions + - name: Check changelog if: ${{ github.event.pull_request.base.sha }} run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - git fetch origin main ${{ github.event.pull_request.base.sha }} ${{ github.head_ref }} - git checkout ${{ github.head_ref }} - VER_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./VERSION) - if ! [ "${VER_DIFF}" ]; then - bash update_version.sh --commit && git push + git fetch origin main ${{ github.event.pull_request.base.sha }} + CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- CHANGELOG.md) + if [ "${CL_DIFF}" ]; then + echo "::error file="CHANGELOG.md",title=Check failed::CHANGELOG.md must be updated!" + exit 1 fi - CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./CHANGELOG.md) - if ! [ "${CL_DIFF}" ]; then - SEARCH_STRING="## Upcoming changes (in development)" - NEW_TITLE="${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }})" - sed -z "s/${SEARCH_STRING}\n/${SEARCH_STRING}\n\n- ${NEW_TITLE}/" -i CHANGELOG.md - git add CHANGELOG.md && git commit -m "Update CHANGELOG" && git push + shell: bash + + check-version: + name: Check if version has been updated + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check version + if: ${{ github.event.pull_request.base.sha }} + run: | + VERSION=$(echo $( Date: Tue, 2 Apr 2024 09:25:35 +0200 Subject: [PATCH 3/8] ci: updated build release workflow --- .github/workflows/build-release.yaml | 74 ++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 95ec0513f..bf869b26b 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -3,24 +3,68 @@ name: Build and Push Multi-Arch Images on: push: branches: - - develop - main - tags: - - "v*.*.*" jobs: - get-tag: - runs-on: ubuntu-latest - name: Get tag + check-version: + name: Check if the version has been updated outputs: - tag: ${{ steps.parse-tag.outputs.tag }} + has_changed: ${{ steps.check.outputs.has_changed }} + version: ${{ steps.versions.outputs.new_version }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: aica-technology/.github/.github/actions/docker-tag-from-git@v0.6.1 - id: parse-tag + with: + fetch-depth: 2 + - id: versions + run: | + PREV_VERSION=$(git show HEAD^:VERSION) + NEW_VERSION=$(git show HEAD:VERSION) + echo "prev_version=${PREV_VERSION}" >> $GITHUB_OUTPUT + echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT + shell: bash + - uses: aica-technology/.github/.github/actions/compare-versions@v0.11.0 + id: check + with: + previous_version: ${{ steps.versions.outputs.prev_version }} + new_version: ${{ steps.versions.outputs.new_version }} + + metadata: + name: Get metadata + needs: check-version + runs-on: ubuntu-latest + outputs: + image_name: ${{ steps.ensure-image.outputs.image_name }} + image_tags: ${{ steps.tags.outputs.image_tags }} + create_tag: ${{ steps.tags.outputs.create_tag }} + git_tag: ${{ steps.tags.outputs.git_tag }} + steps: + - uses: aica-technology/.github/.github/actions/ghcr-ensure-prefix@v0.6.0 + id: ensure-image + with: + image_name: aica-technology/control-libraries + + - run: | + CREATE_TAG=false + GIT_TAG="" + if [ ${{ needs.check-version.outputs.has_changed }} = 'true' ]; then + CREATE_TAG=true + GIT_TAG="v${{ needs.check-version.outputs.version }}" + IMAGE_TAGS=latest,"${GIT_TAG}",rolling + else + IMAGE_TAGS=rolling + fi + echo "Image tags: ${IMAGE_TAGS}" + echo "Create tag: ${CREATE_TAG}" + echo "Git tag: ${GIT_TAG}" + echo "image_tags=${IMAGE_TAGS}" >> $GITHUB_OUTPUT + echo "create_tag=${CREATE_TAG}" >> $GITHUB_OUTPUT + echo "git_tag=${GIT_TAG}" >> $GITHUB_OUTPUT + id: tags + shell: bash build: - needs: [get-tag] + needs: metadata strategy: matrix: arch: [amd64, arm64] @@ -38,13 +82,13 @@ jobs: - uses: aica-technology/.github/.github/actions/list-add-suffixes@v0.6.1 id: merge-tags with: - list: ${{ needs.get-tag.outputs.tag }} + list: ${{ needs.metadata.outputs.image_tags }} suffixes: ${{ matrix.arch }} glue_separator: "-" - uses: aica-technology/.github/.github/actions/ghcr-build@v0.6.1 with: - image_name: aica-technology/control-libraries + image_name: ${{ needs.metadata.outputs.image_name }} image_tags: ${{ steps.merge-tags.outputs.list }} dockerfile_path: Dockerfile token: ${{ secrets.GITHUB_TOKEN }} @@ -52,11 +96,11 @@ jobs: multi-arch: runs-on: ubuntu-latest name: Merge into a multi-arch image - needs: [get-tag, build] + needs: [ metadata, build ] steps: - uses: aica-technology/.github/.github/actions/ghcr-manifest-merge@v0.6.1 with: - image_name: aica-technology/control-libraries - image_tags: ${{ needs.get-tag.outputs.tag }} + image_name: ${{ needs.metadata.outputs.image_name }} + image_tags: ${{ needs.metadata.outputs.image_tags }} archs: amd64,arm64 token: ${{ secrets.GITHUB_TOKEN }} From d64a789c95e77d551514144ff94c538e657930c7 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 2 Apr 2024 09:32:06 +0200 Subject: [PATCH 4/8] ci: doxygen only on tag --- .github/workflows/generate-docs.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 96cdb983f..3bf14b379 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -1,11 +1,8 @@ name: Generate and Deploy Documentation on: - push: - branches: - - main - - develop - release: - types: [published] + push: + tags: + - "v*.*.*" workflow_dispatch: jobs: @@ -22,19 +19,17 @@ jobs: doxyfile-path: 'doxygen.conf' - name: Tag release version - if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'push' }} shell: bash run: | - TAG="${GITHUB_REF#refs/tags/}" - TAG="${TAG/\//-}" mkdir -p doxygen/docs/versions - sudo mv doxygen/docs/html doxygen/docs/versions/${TAG} + sudo mv doxygen/docs/html doxygen/docs/versions/${{ github.ref_name }} - name: Tag branch version - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + if: ${{ github.event_name == 'workflow_dispatch' }} shell: bash run: | - BRANCH="${GITHUB_REF#refs/heads/}" + BRANCH=${{ github.ref_name }} BRANCH="${BRANCH/\//-}" mkdir -p doxygen/docs/versions sudo mv doxygen/docs/html doxygen/docs/versions/${BRANCH} From 6891fe42a1d30c4b0ed1ac721d9be217bfe54263 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 2 Apr 2024 09:33:16 +0200 Subject: [PATCH 5/8] docs: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c4ce120f..1ef6a78eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Release Versions: ## Upcoming changes (in development) +- ci: update workflows (#175) - feat: integrate collision detection feature into robot model (#163) - feat: add IO states to state representation (py) (#173) - ci: use caching from docker to run tests in CI (#429) From 871eb5b1a2d5afd77f10001da0e8a2a3c0d285e6 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Tue, 2 Apr 2024 09:51:27 +0200 Subject: [PATCH 6/8] fixes --- .github/workflows/build-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4cf0d5681..ed7b1cbc4 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -21,7 +21,7 @@ jobs: run: | git fetch origin main ${{ github.event.pull_request.base.sha }} CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- CHANGELOG.md) - if [ "${CL_DIFF}" ]; then + if ! [ "${CL_DIFF}" ]; then echo "::error file="CHANGELOG.md",title=Check failed::CHANGELOG.md must be updated!" exit 1 fi @@ -44,7 +44,7 @@ jobs: echo "::error file="${SOURCE_CMAKE}",title=Check failed::Version in "${SOURCE_CMAKE}" does not correspond to VERSION. ${MESSAGE}" exit 1 fi - PROTO_CMAKE="./protocol/clproto/CMakeLists.txt" + PROTO_CMAKE="./protocol/clproto_cpp/CMakeLists.txt" if [ $(echo $(grep "project(clproto VERSION" "${PROTO_CMAKE}") | tr -d -c 0-9) -ne "${VERSION}" ]; then echo "::error file="${PROTO_CMAKE}",title=Check failed::Version in "${PROTO_CMAKE}" does not correspond to VERSION. ${MESSAGE}" exit 1 @@ -55,10 +55,10 @@ jobs: exit 1 fi DOXY="./doxygen/doxygen.conf" - if [ $(echo $(grep "PROJECT_NUMBER =" ./doxygen/doxygen.conf "${DOXY}") | tr -d -c 0-9) -ne "${VERSION}" ]; then + if [ $(echo $(echo $(grep "PROJECT_NUMBER =" "${DOXY}") | tr -d -c 0-9) | tr -d '\0' ) -ne "${VERSION}" ]; then echo "::error file="${DOXY}",title=Check failed::Version in "${DOXY}" does not correspond to VERSION. ${MESSAGE}" exit 1 - fi" + fi DEMO_CMAKE="./demos/CMakeLists.txt" if [ $(echo $(grep "project(clproto VERSION" "${DEMO_CMAKE}") | tr -d -c 0-9) -ne "${VERSION}" ]; then echo "::error file="${DEMO_CMAKE}",title=Check failed::Version in "${DEMO_CMAKE}" does not correspond to VERSION. ${MESSAGE}" From 3ede5b49b53cd262e66fa93ee107977b1c553aca Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Wed, 3 Apr 2024 13:14:26 +0200 Subject: [PATCH 7/8] 7.3.10 -> 7.3.11 --- VERSION | 2 +- demos/CMakeLists.txt | 2 +- doxygen/doxygen.conf | 2 +- protocol/clproto_cpp/CMakeLists.txt | 2 +- python/setup.py | 2 +- source/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 6fddc82bb..de0fc6a68 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.3.10 +7.3.11 diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 8489fc1db..c38aebb27 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -15,7 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() -find_package(control_libraries 7.3.10 CONFIG REQUIRED) +find_package(control_libraries 7.3.11 CONFIG REQUIRED) set(DEMOS_SCRIPTS task_space_control_loop diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 356825da1..0d7b05028 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 7.3.10 +PROJECT_NUMBER = 7.3.11 # 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 diff --git a/protocol/clproto_cpp/CMakeLists.txt b/protocol/clproto_cpp/CMakeLists.txt index e386a6962..5ddd58432 100644 --- a/protocol/clproto_cpp/CMakeLists.txt +++ b/protocol/clproto_cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(clproto VERSION 7.3.10) +project(clproto VERSION 7.3.11) # Default to C99 if(NOT CMAKE_C_STANDARD) diff --git a/python/setup.py b/python/setup.py index 8cafe31f3..8df606bb3 100644 --- a/python/setup.py +++ b/python/setup.py @@ -11,7 +11,7 @@ # names of the environment variables that define osqp and openrobots include directories osqp_path_var = 'OSQP_INCLUDE_DIR' -__version__ = "7.3.10" +__version__ = "7.3.11" __libraries__ = ['state_representation', 'clproto', 'controllers', 'dynamical_systems', 'robot_model'] __include_dirs__ = ['include'] diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ec3acb614..7859b7a08 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(control_libraries VERSION 7.3.10) +project(control_libraries VERSION 7.3.11) # Build options option(BUILD_TESTING "Build all tests." OFF) From 2c3b3c954faf4e1287b7da7d4857d93bfeff18d8 Mon Sep 17 00:00:00 2001 From: Dominic Reber Date: Mon, 8 Apr 2024 07:24:21 +0200 Subject: [PATCH 8/8] ci: generate docs on main --- .github/workflows/generate-docs.yml | 51 +++++++++++++++++++---------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 3bf14b379..0beed7a76 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -1,16 +1,39 @@ name: Generate and Deploy Documentation on: - push: - tags: - - "v*.*.*" - workflow_dispatch: + push: + branches: + - main jobs: + check-version: + name: Check if the version has been updated + outputs: + has_changed: ${{ steps.check.outputs.has_changed }} + version: ${{ steps.versions.outputs.new_version }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + - id: versions + run: | + PREV_VERSION=$(git show HEAD^:VERSION) + NEW_VERSION=$(git show HEAD:VERSION) + echo "prev_version=${PREV_VERSION}" >> $GITHUB_OUTPUT + echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT + shell: bash + - uses: aica-technology/.github/.github/actions/compare-versions@v0.11.0 + id: check + with: + previous_version: ${{ steps.versions.outputs.prev_version }} + new_version: ${{ steps.versions.outputs.new_version }} + deploy: + needs: check-version name: Generate and Deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - name: Generate docs uses: mattnotmitt/doxygen-action@v1 @@ -18,21 +41,15 @@ jobs: working-directory: 'doxygen' doxyfile-path: 'doxygen.conf' - - name: Tag release version - if: ${{ github.event_name == 'push' }} - shell: bash - run: | - mkdir -p doxygen/docs/versions - sudo mv doxygen/docs/html doxygen/docs/versions/${{ github.ref_name }} - - - name: Tag branch version - if: ${{ github.event_name == 'workflow_dispatch' }} + - name: Tag version shell: bash run: | - BRANCH=${{ github.ref_name }} - BRANCH="${BRANCH/\//-}" mkdir -p doxygen/docs/versions - sudo mv doxygen/docs/html doxygen/docs/versions/${BRANCH} + sudo mv doxygen/docs/html doxygen/docs/versions/rolling + if [ ${{ needs.check-version.outputs.has_changed }} ]; then + sudo cp doxygen/docs/versions/rolling doxygen/docs/versions/latest + sudo cp doxygen/docs/versions/rolling doxygen/docs/versions/${{ needs.check-version.outputs.version }} + fi - name: Deploy to documentation branch uses: peaceiris/actions-gh-pages@v3