Skip to content

Commit

Permalink
build: prepare workflows for deletion of develop branch (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
domire8 authored Oct 23, 2023
1 parent b8e61ce commit 06b8bc8
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 43 deletions.
76 changes: 60 additions & 16 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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 }}
1 change: 0 additions & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- develop
release:
types: [published]
workflow_dispatch:
Expand Down
32 changes: 12 additions & 20 deletions .github/workflows/build-test.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
3.1.2
2 changes: 1 addition & 1 deletion doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_component_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_component_interfaces</name>
<version>3.1.1</version>
<version>3.1.2</version>
<description>Interface package for communicating with modulo components through the ROS framework</description>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
<license>GPLv3</license>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_components/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_components</name>
<version>3.1.1</version>
<version>3.1.2</version>
<description>Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework</description>
<maintainer email="baptiste@aica.tech">Baptiste Busch</maintainer>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_core</name>
<version>3.1.1</version>
<version>3.1.2</version>
<description>Modulo Core communication and translation utilities for interoperability with AICA Control Libraries</description>
<maintainer email="baptiste@aica.tech">Baptiste Busch</maintainer>
<maintainer email="enrico@aica.tech">Enrico Eberhard</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_utils/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>modulo_utils</name>
<version>3.1.1</version>
<version>3.1.2</version>
<description>Modulo utils package for shared test fixtures</description>
<maintainer email="dominic@aica.tech">Dominic Reber</maintainer>
<license>GPLv3</license>
Expand Down

0 comments on commit 06b8bc8

Please sign in to comment.