From 087903e95eb73ab5a9ac2bad1cc6f9fbe446bbb8 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 11:54:33 +0200 Subject: [PATCH 01/19] Change branch name --- .github/workflows/ros-docker-image.yaml | 2 +- Dockerfile.hardware | 2 +- Dockerfile.simulation | 2 +- README.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 8d46ff7..ac85297 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -60,7 +60,7 @@ jobs: with: dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} - main_branch_name: ros2-devel + main_branch_name: ros2 dockerfile: ${{ matrix.dockerfile }} repo_name: ${{ matrix.repo_name }} build_type: ${{ inputs.build_type }} diff --git a/Dockerfile.hardware b/Dockerfile.hardware index dc5d48f..e6533ac 100644 --- a/Dockerfile.hardware +++ b/Dockerfile.hardware @@ -13,7 +13,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ros2 https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_hardware.repos && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers && \ # Install dependencies diff --git a/Dockerfile.simulation b/Dockerfile.simulation index 3c8bb3f..29b8459 100644 --- a/Dockerfile.simulation +++ b/Dockerfile.simulation @@ -13,7 +13,7 @@ RUN apt-get update && \ apt-get install -y \ ros-dev-tools && \ # Setup workspace - git clone -b ros2-devel https://github.com/husarion/panther_ros.git src/panther_ros && \ + git clone -b ros2 https://github.com/husarion/panther_ros.git src/panther_ros && \ vcs import src < src/panther_ros/panther/panther_hardware.repos && \ vcs import src < src/panther_ros/panther/panther_simulation.repos && \ cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers && \ diff --git a/README.md b/README.md index 3747345..9ba248d 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Docker images dedicated to Husarion Panther ROS system and simulation. ## Docker Images -Docker images are automatically deployed to Docker Hub. Image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2-devel) repository, and the date of release. Additionally stable image versions are tagged with `stable` and recommended for production use. -Below, you can find a list of available Docker images. To access the latest tag, simply follow provided links: +Docker images are automatically deployed to Docker Hub. The image tag includes information about the ROS distribution, the version of the [panther_ros](https://github.com/husarion/panther_ros/tree/ros2) repository, and the date of release. Additionally, stable image versions are tagged with `stable` and recommended for production use. +Below, you can find a list of available Docker images. To access the latest tag, simply follow the provided links: - [husarion/panther](https://hub.docker.com/r/husarion/panther) - ROS packages for Panther robot, - [husarion/panther-gazebo](https://hub.docker.com/r/husarion/panther-gazebo) - Simulation for Panther robot in Gazebo-classic. From 17afe72d0e38dd2012b94bdbc9b788a7df6d44ed Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:18:12 +0200 Subject: [PATCH 02/19] Update release workflow --- .github/workflows/release-repository.yaml | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/release-repository.yaml diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml new file mode 100644 index 0000000..a1890e8 --- /dev/null +++ b/.github/workflows/release-repository.yaml @@ -0,0 +1,86 @@ +--- +name: Release repository + +on: + pull_request: + workflow_dispatch: + inputs: + target_branch: + description: Target branch for the release. + required: true + version: + description: New version (used for tag and package versioning). + required: true + release_name: + description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). + required: true + automatic_mode: + type: boolean + default: false + description: Automatically merge PR and create release. + prerelease: + type: boolean + default: false + description: Mark the release as a prerelease. + +jobs: + release: + name: Release repository + runs-on: ubuntu-22.04 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.target_branch }} + + - name: Create release candidate + id: create_release_candidate + uses: at-wat/catkin-release-action@v1 + with: + version: ${{ github.event.inputs.version }} + git_user: action-bot + git_email: action-bot@action-bot.com + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update docker image version + uses: mikefarah/yq@v4.43.1 + with: + cmd: yq -i '.services.panther_ros.image = new_tag' demo/compose.minimal-setup.yaml + + - name: Create pull request + run: | + gh pr create \ + --base ${{ github.event.inputs.target_branch }} \ + --head ${{ steps.create_release_candidate.outputs.created_branch }} \ + --title "Release ${{ steps.create_release_candidate.outputs.version}}" \ + --body "This PR incorporates package(s) version and changelog update." + + - name: Merge pull request + if: ${{ github.event.inputs.automatic_mode == true }} + run: | + gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \ + --delete-branch + + - name: Create tag + if: ${{ github.event.inputs.automatic_mode == true }} + run: | + git checkout ${{ github.event.inputs.target_branch }} + git tag ${{ steps.create_release_candidate.outputs.version }} + git push origin ${{ steps.create_release_candidate.outputs.version }} + + - name: Create prerelease + if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == true}} + run: | + gh release create ${{ steps.create_release_candidate.outputs.version }} \ + --title ${{ github.event.inputs.release_name }} \ + --notes-from-tag \ + --prerelease + + - name: Create release + if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == false}} + run: | + gh release create ${{ steps.create_release_candidate.outputs.version }} \ + --title ${{ github.event.inputs.release_name }} \ + --notes-from-tag From 8715f2514e23bf5fe71772dc88d9509140456045 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:27:56 +0200 Subject: [PATCH 03/19] Remove pr trigger --- .github/workflows/release-repository.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index a1890e8..b553caa 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -2,7 +2,6 @@ name: Release repository on: - pull_request: workflow_dispatch: inputs: target_branch: From 3a1c6096d9ddc134576a8f46dd1887c4834b2e89 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:46:21 +0200 Subject: [PATCH 04/19] Prune catkin dependencies --- .github/workflows/release-repository.yaml | 27 ++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index b553caa..4f2a5c0 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -28,20 +28,17 @@ jobs: runs-on: ubuntu-22.04 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BRANCH: release-${{ github.event.inputs.version }} steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.target_branch }} - - name: Create release candidate - id: create_release_candidate - uses: at-wat/catkin-release-action@v1 - with: - version: ${{ github.event.inputs.version }} - git_user: action-bot - git_email: action-bot@action-bot.com - github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Create release branch + run: | + git checkout -b $RELEASE_BRANCH + git push -u origin $RELEASE_BRANCH - name: Update docker image version uses: mikefarah/yq@v4.43.1 @@ -52,27 +49,27 @@ jobs: run: | gh pr create \ --base ${{ github.event.inputs.target_branch }} \ - --head ${{ steps.create_release_candidate.outputs.created_branch }} \ - --title "Release ${{ steps.create_release_candidate.outputs.version}}" \ + --head $RELEASE_BRANCH \ + --title "Release ${{ github.event.inputs.version }}" \ --body "This PR incorporates package(s) version and changelog update." - name: Merge pull request if: ${{ github.event.inputs.automatic_mode == true }} run: | - gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \ + gh pr merge $RELEASE_BRANCH \ --delete-branch - name: Create tag if: ${{ github.event.inputs.automatic_mode == true }} run: | git checkout ${{ github.event.inputs.target_branch }} - git tag ${{ steps.create_release_candidate.outputs.version }} - git push origin ${{ steps.create_release_candidate.outputs.version }} + git tag ${{ github.event.inputs.version }} + git push origin ${{ github.event.inputs.version }} - name: Create prerelease if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == true}} run: | - gh release create ${{ steps.create_release_candidate.outputs.version }} \ + gh release create ${{ github.event.inputs.version }} \ --title ${{ github.event.inputs.release_name }} \ --notes-from-tag \ --prerelease @@ -80,6 +77,6 @@ jobs: - name: Create release if: ${{ github.event.inputs.automatic_mode == true && github.event.inputs.prerelease == false}} run: | - gh release create ${{ steps.create_release_candidate.outputs.version }} \ + gh release create ${{ github.event.inputs.version }} \ --title ${{ github.event.inputs.release_name }} \ --notes-from-tag From 1ed1b9ddc2437a7b21c4d1b72eb715f99ba43227 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:49:26 +0200 Subject: [PATCH 05/19] add qoutes --- .github/workflows/release-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 4f2a5c0..042d696 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -43,7 +43,7 @@ jobs: - name: Update docker image version uses: mikefarah/yq@v4.43.1 with: - cmd: yq -i '.services.panther_ros.image = new_tag' demo/compose.minimal-setup.yaml + cmd: yq -i '.services.panther_ros.image = \"new_tag\"' demo/compose.minimal-setup.yaml - name: Create pull request run: | From 51c045a1ae687fa086be01cdf7a46d0fb9b34887 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:51:12 +0200 Subject: [PATCH 06/19] edit qotes --- .github/workflows/release-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 042d696..cd9f2dd 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -43,7 +43,7 @@ jobs: - name: Update docker image version uses: mikefarah/yq@v4.43.1 with: - cmd: yq -i '.services.panther_ros.image = \"new_tag\"' demo/compose.minimal-setup.yaml + cmd: yq -i '.services.panther_ros.image = "new_tag"' demo/compose.minimal-setup.yaml - name: Create pull request run: | From e7440e391e3b2bc1048e460eb10cf39ed70f221c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 13:54:32 +0200 Subject: [PATCH 07/19] Add step for commit changes --- .github/workflows/release-repository.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index cd9f2dd..8628e9c 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -45,6 +45,12 @@ jobs: with: cmd: yq -i '.services.panther_ros.image = "new_tag"' demo/compose.minimal-setup.yaml + - name: Commit changes + run: | + git add . + git commit -m "Update docker image version" + git push origin $RELEASE_BRANCH + - name: Create pull request run: | gh pr create \ From 62a8eac187953cf404f530018ff6500304df1500 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 14:02:59 +0200 Subject: [PATCH 08/19] Use action for commiting --- .github/workflows/release-repository.yaml | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 8628e9c..221af7d 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -35,21 +35,29 @@ jobs: with: ref: ${{ github.event.inputs.target_branch }} - - name: Create release branch - run: | - git checkout -b $RELEASE_BRANCH - git push -u origin $RELEASE_BRANCH + # - name: Create release branch + # run: | + # git checkout -b $RELEASE_BRANCH + # git push -u origin $RELEASE_BRANCH - name: Update docker image version uses: mikefarah/yq@v4.43.1 with: cmd: yq -i '.services.panther_ros.image = "new_tag"' demo/compose.minimal-setup.yaml - - name: Commit changes - run: | - git add . - git commit -m "Update docker image version" - git push origin $RELEASE_BRANCH + # - name: Commit changes + # run: | + # git add . + # git commit -m "Update docker image version" + # git push origin $RELEASE_BRANCH + + - name: Commit changes to release branch + uses: EndBug/add-and-commit@v9 + with: + message: Update docker image version + author_name: action-bot + author_email: action-bot@action-bot.com + new_branch: $RELEASE_BRANCH - name: Create pull request run: | From 62078c30369c93e318f2735e99bf2305db461c27 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 14:08:14 +0200 Subject: [PATCH 09/19] Resolve branch name --- .github/workflows/release-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 221af7d..a6f408e 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -57,7 +57,7 @@ jobs: message: Update docker image version author_name: action-bot author_email: action-bot@action-bot.com - new_branch: $RELEASE_BRANCH + new_branch: ${{ RELEASE_BRANCH }} - name: Create pull request run: | From a3deae52350526794bd4aefea2fb2c3fd95da33c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 14:10:29 +0200 Subject: [PATCH 10/19] add env specifier --- .github/workflows/release-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index a6f408e..085e9b7 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -57,7 +57,7 @@ jobs: message: Update docker image version author_name: action-bot author_email: action-bot@action-bot.com - new_branch: ${{ RELEASE_BRANCH }} + new_branch: ${{ env.RELEASE_BRANCH }} - name: Create pull request run: | From 577bc77b17400517a82f92821b3ff1abc954c9bf Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 15:18:21 +0200 Subject: [PATCH 11/19] Add simulation compose edit --- .github/workflows/release-repository.yaml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 085e9b7..ed8117a 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -8,7 +8,10 @@ on: description: Target branch for the release. required: true version: - description: New version (used for tag and package versioning). + description: New version (used for tag). + required: true + image_timestamp: + description: Timestamp of the image to be used in the compose files. required: true release_name: description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). @@ -29,27 +32,19 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_BRANCH: release-${{ github.event.inputs.version }} + DOCKER_IMAGE: husarion/panther-gazebo:humble-${{ github.event.inputs.version }}-${{ github.event.inputs.image_timestamp }} steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.target_branch }} - # - name: Create release branch - # run: | - # git checkout -b $RELEASE_BRANCH - # git push -u origin $RELEASE_BRANCH - - name: Update docker image version uses: mikefarah/yq@v4.43.1 with: - cmd: yq -i '.services.panther_ros.image = "new_tag"' demo/compose.minimal-setup.yaml - - # - name: Commit changes - # run: | - # git add . - # git commit -m "Update docker image version" - # git push origin $RELEASE_BRANCH + cmd: | + yq -i '.services.panther_ros.image = "${{ env.DOCKER_IMAGE }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_gazebo.image = "${{ env.DOCKER_IMAGE }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml - name: Commit changes to release branch uses: EndBug/add-and-commit@v9 From 451d980e85d5593bcffac31021f96aa1a7b993de Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 15:24:51 +0200 Subject: [PATCH 12/19] Fix tagging --- .github/workflows/release-repository.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index ed8117a..ebc363f 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -32,7 +32,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_BRANCH: release-${{ github.event.inputs.version }} - DOCKER_IMAGE: husarion/panther-gazebo:humble-${{ github.event.inputs.version }}-${{ github.event.inputs.image_timestamp }} + DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.version }}-${{ github.event.inputs.image_timestamp }} steps: - name: Checkout uses: actions/checkout@v4 @@ -43,8 +43,8 @@ jobs: uses: mikefarah/yq@v4.43.1 with: cmd: | - yq -i '.services.panther_ros.image = "${{ env.DOCKER_IMAGE }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml - yq -i '.services.panther_gazebo.image = "${{ env.DOCKER_IMAGE }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml + yq -i '.services.panther_ros.image = " husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml - name: Commit changes to release branch uses: EndBug/add-and-commit@v9 From 61fe2b9775801074cf9fbc65fde71c1dc8c96d1c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 15:26:13 +0200 Subject: [PATCH 13/19] fix quotes --- .github/workflows/release-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index ebc363f..5e5a3bb 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -43,7 +43,7 @@ jobs: uses: mikefarah/yq@v4.43.1 with: cmd: | - yq -i '.services.panther_ros.image = " husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_ros.image = "husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml - name: Commit changes to release branch From de1f74874401befc26d32bdd99a47873f766423a Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 15:56:49 +0200 Subject: [PATCH 14/19] Disable workflow on pull request closed --- .github/workflows/ros-docker-image.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index ac85297..69fb4d0 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -16,7 +16,7 @@ on: description: In case of "stable" release specify the ROS distro of the existing docker image (eg. humble) type: string - default: ardent + default: humble target_release: description: In case of "stable" release specify the version of the existing docker image (eg. 1.0.12) @@ -27,12 +27,13 @@ on: YYYYMMDD (eg. 20220124) type: string default: '20131206' - repository_dispatch: - types: [rebuild, ros-package-update] - pull_request: - types: - - closed - - opened + # TODO: disabled when creating the release pipeline + # repository_dispatch: + # types: [rebuild, ros-package-update] + # pull_request: + # types: + # - closed + # - opened jobs: build: From 91cad1cad349802312ebf22f33a77804a7730f0c Mon Sep 17 00:00:00 2001 From: pawelirh Date: Thu, 25 Apr 2024 16:09:58 +0200 Subject: [PATCH 15/19] Rename input --- .github/workflows/release-repository.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-repository.yaml b/.github/workflows/release-repository.yaml index 5e5a3bb..1d3f289 100644 --- a/.github/workflows/release-repository.yaml +++ b/.github/workflows/release-repository.yaml @@ -10,8 +10,8 @@ on: version: description: New version (used for tag). required: true - image_timestamp: - description: Timestamp of the image to be used in the compose files. + date: + description: Date stamp of the image to be used in the compose files. required: true release_name: description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`). @@ -32,7 +32,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} RELEASE_BRANCH: release-${{ github.event.inputs.version }} - DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.version }}-${{ github.event.inputs.image_timestamp }} + DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.version }}-${{ github.event.inputs.date }} steps: - name: Checkout uses: actions/checkout@v4 From 4393facf647a61dfa8ed4384dee884000e553f2f Mon Sep 17 00:00:00 2001 From: pawelirh Date: Fri, 26 Apr 2024 13:17:44 +0200 Subject: [PATCH 16/19] Create prepare test branch workflow --- .github/workflows/prepare-test-branch.yaml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/prepare-test-branch.yaml diff --git a/.github/workflows/prepare-test-branch.yaml b/.github/workflows/prepare-test-branch.yaml new file mode 100644 index 0000000..f355d6c --- /dev/null +++ b/.github/workflows/prepare-test-branch.yaml @@ -0,0 +1,40 @@ +--- +name: Prepare test branch + +on: + workflow_dispatch: + inputs: + target_branch: + description: Target branch for the pre-release test. + required: true + test_branch: + description: Test branch name (used as a docker image tag). + required: true + +jobs: + release: + name: Release repository + runs-on: ubuntu-22.04 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_IMAGE_TAG: humble-${{ github.event.inputs.test_branch }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.target_branch }} + + - name: Update docker image version + uses: mikefarah/yq@v4.43.1 + with: + cmd: | + yq -i '.services.panther_ros.image = "husarion/panther:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.minimal-setup.yaml + yq -i '.services.panther_gazebo.image = "husarion/panther-gazebo:${{ env.DOCKER_IMAGE_TAG }}" | (... | select(tag == "!!merge")) tag = ""' demo/compose.simulation.yaml + + - name: Commit changes to test branch + uses: EndBug/add-and-commit@v9 + with: + message: Update docker image version + author_name: action-bot + author_email: action-bot@action-bot.com + new_branch: ${{ github.event.inputs.test_branch }} From 824d422e02dc36610b2884b0d2b9d88669d0ccd9 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Fri, 26 Apr 2024 13:22:06 +0200 Subject: [PATCH 17/19] register --- .github/workflows/prepare-test-branch.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prepare-test-branch.yaml b/.github/workflows/prepare-test-branch.yaml index f355d6c..8c5fabc 100644 --- a/.github/workflows/prepare-test-branch.yaml +++ b/.github/workflows/prepare-test-branch.yaml @@ -2,6 +2,8 @@ name: Prepare test branch on: + pull_request: + workflow_dispatch: inputs: target_branch: From 13e1f115a98e5018791d0cef479eb62be0037676 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Fri, 26 Apr 2024 13:22:41 +0200 Subject: [PATCH 18/19] remove pr trigger --- .github/workflows/prepare-test-branch.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/prepare-test-branch.yaml b/.github/workflows/prepare-test-branch.yaml index 8c5fabc..f355d6c 100644 --- a/.github/workflows/prepare-test-branch.yaml +++ b/.github/workflows/prepare-test-branch.yaml @@ -2,8 +2,6 @@ name: Prepare test branch on: - pull_request: - workflow_dispatch: inputs: target_branch: From 26109223f33d05cb9c5c51fe163286c4ac27ed25 Mon Sep 17 00:00:00 2001 From: pawelirh Date: Mon, 29 Apr 2024 11:15:30 +0200 Subject: [PATCH 19/19] Remove unused inputs --- .github/workflows/ros-docker-image.yaml | 124 +++++++++++------------- 1 file changed, 59 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ros-docker-image.yaml b/.github/workflows/ros-docker-image.yaml index 69fb4d0..08cdcda 100644 --- a/.github/workflows/ros-docker-image.yaml +++ b/.github/workflows/ros-docker-image.yaml @@ -2,72 +2,66 @@ name: Build/Publish ROS Docker Image on: - workflow_dispatch: - inputs: - build_type: - description: Is it a "development" or a "stable" release? - required: true - default: development - type: choice - options: - - development - - stable - target_distro: - description: In case of "stable" release specify the ROS distro of the existing docker image (eg. - humble) - type: string - default: humble - target_release: - description: In case of "stable" release specify the version of the existing docker image (eg. - 1.0.12) - type: string - default: 0.0.0 - target_date: - description: In case of "stable" release specify the date of the existing docker image in format - YYYYMMDD (eg. 20220124) - type: string - default: '20131206' - # TODO: disabled when creating the release pipeline - # repository_dispatch: - # types: [rebuild, ros-package-update] - # pull_request: - # types: - # - closed - # - opened + workflow_dispatch: + inputs: + build_type: + description: Is it a "development" or a "stable" release? + required: true + default: development + type: choice + options: + - development + - stable + target_distro: + description: + In case of "stable" release specify the ROS distro of the existing docker image (eg. + humble) + type: string + default: humble + target_release: + description: + In case of "stable" release specify the version of the existing docker image (eg. + 1.0.12) + type: string + default: 0.0.0 + target_date: + description: + In case of "stable" release specify the date of the existing docker image in format + YYYYMMDD (eg. 20220124) + type: string + default: "20131206" jobs: - build: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: + build: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + include: + - dockerfile: Dockerfile.hardware + platforms: linux/arm64 + ros_distro: humble + - dockerfile: Dockerfile.simulation + repo_name: panther-gazebo + platforms: linux/amd64 + ros_distro: humble - include: - - dockerfile: Dockerfile.hardware - platforms: linux/arm64 - ros_distro: humble - - dockerfile: Dockerfile.simulation - repo_name: panther-gazebo - platforms: linux/amd64 - ros_distro: humble + steps: + - name: Checkout + uses: actions/checkout@v2 - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Build Docker Image - uses: husarion-ci/ros-docker-img-action@v0.5 - with: - dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} - dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} - main_branch_name: ros2 - dockerfile: ${{ matrix.dockerfile }} - repo_name: ${{ matrix.repo_name }} - build_type: ${{ inputs.build_type }} - ros_distro: ${{ matrix.ros_distro }} - platforms: ${{ matrix.platforms }} - # variables important only for stable release - target_distro: ${{ inputs.target_distro }} - target_release: ${{ inputs.target_release }} - target_date: ${{ inputs.target_date }} + - name: Build Docker Image + uses: husarion-ci/ros-docker-img-action@v0.5 + with: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }} + main_branch_name: ros2 + dockerfile: ${{ matrix.dockerfile }} + repo_name: ${{ matrix.repo_name }} + build_type: ${{ inputs.build_type }} + ros_distro: ${{ matrix.ros_distro }} + platforms: ${{ matrix.platforms }} + # variables important only for stable release + target_distro: ${{ inputs.target_distro }} + target_release: ${{ inputs.target_release }} + target_date: ${{ inputs.target_date }}