From 06b8bc87052447c3f5b9f03569abdf8091014605 Mon Sep 17 00:00:00 2001 From: Dominic Reber <71256590+domire8@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:39:02 +0200 Subject: [PATCH] build: prepare workflows for deletion of develop branch (#58) --- .github/workflows/build-release.yaml | 76 +++++++++++++++---- .github/workflows/generate-docs.yml | 1 - .../workflows/{build-test.yml => test.yml} | 32 +++----- CHANGELOG.md | 1 + VERSION | 2 +- doxygen/doxygen.conf | 2 +- .../modulo_component_interfaces/package.xml | 2 +- source/modulo_components/package.xml | 2 +- source/modulo_core/package.xml | 2 +- source/modulo_utils/package.xml | 2 +- 10 files changed, 79 insertions(+), 43 deletions(-) rename .github/workflows/{build-test.yml => test.yml} (51%) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index ad910835a..209faaec8 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -1,26 +1,70 @@ -name: Build and Push Multi-Arch Images +name: Build and release 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/modulo + + - 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,24 +82,24 @@ jobs: - uses: aica-technology/.github/.github/actions/list-add-suffixes@v0.6.0 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/modulo + image_name: ${{ needs.metadata.outputs.image_name }} image_tags: ${{ steps.merge-tags.outputs.list }} token: ${{ secrets.GITHUB_TOKEN }} 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/modulo - 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 }} diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 96cdb983f..67d8abdd3 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - develop release: types: [published] workflow_dispatch: diff --git a/.github/workflows/build-test.yml b/.github/workflows/test.yml similarity index 51% rename from .github/workflows/build-test.yml rename to .github/workflows/test.yml index 73953132f..a6e5e3fda 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/test.yml @@ -1,27 +1,20 @@ -name: Build and Test +name: Check CHANGELOG update and run tests on: pull_request: - workflow_dispatch: jobs: - check: - 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@v3 - - name: Check changelog - run: | + - uses: actions/checkout@v3 + - run: | git fetch origin main ${{ github.event.pull_request.base.sha }} - VER_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./VERSION) - if ! [ "${VER_DIFF}" ]; then - echo "::warning title=Version check failed::VERSION must be updated!" - exit 1 - fi - CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./CHANGELOG.md) - if ! [ "${CL_DIFF}" ]; then - echo "::warning title=CHEANGELOG check failed::CHANGELOG.md must be updated!" + PACKAGE_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./source) + CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- CHANGELOG.md) + if [ "${PACKAGE_DIFF}" ] && ! [ "${CL_DIFF}" ]; then + echo "::error file="CHANGELOG.md",title=Check failed::CHANGELOG.md must be updated!" exit 1 fi shell: bash @@ -30,14 +23,13 @@ jobs: name: Check skippable changes runs-on: ubuntu-latest outputs: - skip: ${{ steps.check_if_skippable.outputs.should_skip }} + skip: ${{ steps.check.outputs.should_skip }} steps: - - id: check_if_skippable + - id: check uses: fkirc/skip-duplicate-actions@master with: cancel_others: 'true' - do_not_skip: '["workflow_dispatch"]' - paths_ignore: '["**.md"]' + paths_ignore: '["**.md", ".**/**", "**.gitignore", "**.sh"]' skip_after_successful_duplicate: 'true' test: diff --git a/CHANGELOG.md b/CHANGELOG.md index bfc73a7d5..56df1f33e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Release Versions: ## Upcoming changes (in development) - feat: add rate parameter to component interface (#57) +- build: prepare workflows for deletion of develop branch (#58) ## 3.1.0 diff --git a/VERSION b/VERSION index 94ff29cc4..ef538c281 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.1 +3.1.2 diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 790aca992..8697abd93 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Modulo" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 3.1.1 +PROJECT_NUMBER = 3.1.2 # 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/source/modulo_component_interfaces/package.xml b/source/modulo_component_interfaces/package.xml index 6bfad9021..351f83ce9 100644 --- a/source/modulo_component_interfaces/package.xml +++ b/source/modulo_component_interfaces/package.xml @@ -2,7 +2,7 @@ modulo_component_interfaces - 3.1.1 + 3.1.2 Interface package for communicating with modulo components through the ROS framework Enrico Eberhard GPLv3 diff --git a/source/modulo_components/package.xml b/source/modulo_components/package.xml index 43fa8d44e..b59f46289 100644 --- a/source/modulo_components/package.xml +++ b/source/modulo_components/package.xml @@ -2,7 +2,7 @@ modulo_components - 3.1.1 + 3.1.2 Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework Baptiste Busch Enrico Eberhard diff --git a/source/modulo_core/package.xml b/source/modulo_core/package.xml index c0ce65ba8..6749d991a 100644 --- a/source/modulo_core/package.xml +++ b/source/modulo_core/package.xml @@ -2,7 +2,7 @@ modulo_core - 3.1.1 + 3.1.2 Modulo Core communication and translation utilities for interoperability with AICA Control Libraries Baptiste Busch Enrico Eberhard diff --git a/source/modulo_utils/package.xml b/source/modulo_utils/package.xml index f89732af1..168023e68 100644 --- a/source/modulo_utils/package.xml +++ b/source/modulo_utils/package.xml @@ -2,7 +2,7 @@ modulo_utils - 3.1.1 + 3.1.2 Modulo utils package for shared test fixtures Dominic Reber GPLv3