Skip to content

Commit

Permalink
Merge pull request #60 from husarion/2.0.3-20240606
Browse files Browse the repository at this point in the history
Release 2.0.3 to ros2
  • Loading branch information
github-actions[bot] authored Jun 6, 2024
2 parents c76be11 + 459a900 commit fbd9755
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 85 deletions.
17 changes: 17 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: "en-US"
early_access: false
reviews:
profile: "chill"
request_changes_workflow: false
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: false
auto_review:
enabled: true
drafts: false
base_branches:
- "ros2-devel"
chat:
auto_reply: true
2 changes: 1 addition & 1 deletion .github/workflows/colcon_test_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ROS2 test build
on:
push:
branches:
- 'ros2'
- "ros2"

jobs:
colcon-test-build:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/protect-default-branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate PR head branch
on:
pull_request:
branches:
- "ros2"

jobs:
check-head-branch:
runs-on: ubuntu-latest
steps:
- name: Check allowed branches
run: |
pattern="^[0-9]+\.[0-9]+\.[0-9]+-[0-9]{8}$" # This regex matches the X.X.X-YYYYMMDD pattern
if [[ "${{ github.head_ref }}" == *"hotfix"* ]]; then
echo "PR from a branch containing 'hotfix' is allowed."
exit 0
elif [[ "${{ github.head_ref }}" =~ $pattern ]]; then
echo "PR from a branch matching X.X.X-YYYYMMDD pattern is allowed."
exit 0
else
echo "PRs must come from branches containing 'hotfix' phrase or matching X.X.X-YYYYMMDD pattern."
exit 1
fi
185 changes: 102 additions & 83 deletions .github/workflows/release-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,96 +2,115 @@
name: Release repository

on:
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.
workflow_dispatch:
inputs:
release_candidate:
description: Branch name of the release candidate.
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 }}
MAIN_BRANCH: ros2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.target_branch }}
release:
name: Release repository
runs-on: ubuntu-22.04
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAIN_BRANCH: ros2
DEVEL_BRANCH: ros2-devel
steps:
- name: Checkout to rc branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.release_candidate }}

- 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: Catkin release
id: catkin_release
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 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: Catkin release - create PR
run: |
gh pr create \
--base ${{ github.event.inputs.release_candidate }} \
--head ${{ steps.catkin_release.outputs.created_branch }} \
--title "Release ${{ steps.catkin_release.outputs.version}}" \
--body "This PR incorporates package(s) version and changelog update."
- name: Merge pull request
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
run: |
gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \
--merge --delete-branch
- name: Catkin release - merge PR
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
run: |
gh pr merge ${{ steps.catkin_release.outputs.created_branch }} \
--merge --delete-branch
- name: Checkout to main
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
uses: actions/checkout@v4
with:
ref: ${{ env.MAIN_BRANCH }}
- name: Checkout to main branch
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
== true }}
uses: actions/checkout@v4
with:
ref: ${{ env.MAIN_BRANCH }}

- name: Create pull request to main
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
run: |
gh pr create \
--base ${{ env.MAIN_BRANCH }} \
--head ${{ github.event.inputs.target_branch }} \
--title "Release ${{ steps.create_release_candidate.outputs.version}} to ${{ env.MAIN_BRANCH }}" \
--body "This PR incorporates package(s) version and changelog update."
- name: Create PR to main branch
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
== true }}
run: |
gh pr create \
--base ${{ env.MAIN_BRANCH }} \
--head ${{ github.event.inputs.release_candidate }} \
--title "Release ${{ steps.catkin_release.outputs.version}} to ${{ env.MAIN_BRANCH }}" \
--body "This PR incorporates package(s) version and changelog update."
- name: Merge pull request to main
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
run: |
gh pr merge ${{ github.event.inputs.target_branch }} \
--merge --delete-branch
- name: Merge PR to main branch
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
== true }}
run: |
gh pr merge ${{ github.event.inputs.release_candidate }} \
--merge --delete-branch
- name: Create prerelease
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == true}}
run: |
gh release create ${{ steps.create_release_candidate.outputs.version }} \
--target ${{ env.MAIN_BRANCH }} \
--title ${{ github.event.inputs.release_name }} \
--generate-notes \
--prerelease
- name: Create prerelease
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
== true}}
run: |
gh release create ${{ steps.catkin_release.outputs.version }} \
--target ${{ env.MAIN_BRANCH }} \
--title ${{ github.event.inputs.release_name }} \
--generate-notes \
--prerelease
- name: Create release
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == false}}
run: |
gh release create ${{ steps.create_release_candidate.outputs.version }} \
--target ${{ env.MAIN_BRANCH }} \
--title ${{ github.event.inputs.release_name }} \
--generate-notes
- name: Create release
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
== false}}
run: |
gh release create ${{ steps.catkin_release.outputs.version }} \
--target ${{ env.MAIN_BRANCH }} \
--title ${{ github.event.inputs.release_name }} \
--generate-notes
- name: Checkout to devel branch
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
uses: actions/checkout@v4
with:
ref: ${{ env.DEVEL_BRANCH }}

- name: Update devel branch
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
run: |
git pull origin ${{ env.MAIN_BRANCH }}
git push origin ${{ env.DEVEL_BRANCH }}
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package panther_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.0.3 (2024-06-06)
------------------
* Ros2 improve release process (`#58 <https://github.com/husarion/panther_msgs/issues/58>`_)
* Contributors: Paweł Irzyk

2.0.2 (2024-06-05)
------------------

Expand Down
2 changes: 1 addition & 1 deletion 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>panther_msgs</name>
<version>2.0.2</version>
<version>2.0.3</version>
<description>Custom messages for Panther robot.</description>
<maintainer email="support@husarion.com">Husarion</maintainer>
<license>Apache License 2.0</license>
Expand Down

0 comments on commit fbd9755

Please sign in to comment.