Skip to content

Commit fbd9755

Browse files
Merge pull request #60 from husarion/2.0.3-20240606
Release 2.0.3 to ros2
2 parents c76be11 + 459a900 commit fbd9755

6 files changed

+149
-85
lines changed

.coderabbit.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
language: "en-US"
3+
early_access: false
4+
reviews:
5+
profile: "chill"
6+
request_changes_workflow: false
7+
high_level_summary: true
8+
poem: false
9+
review_status: true
10+
collapse_walkthrough: false
11+
auto_review:
12+
enabled: true
13+
drafts: false
14+
base_branches:
15+
- "ros2-devel"
16+
chat:
17+
auto_reply: true

.github/workflows/colcon_test_build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ROS2 test build
33
on:
44
push:
55
branches:
6-
- 'ros2'
6+
- "ros2"
77

88
jobs:
99
colcon-test-build:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Validate PR head branch
2+
on:
3+
pull_request:
4+
branches:
5+
- "ros2"
6+
7+
jobs:
8+
check-head-branch:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check allowed branches
12+
run: |
13+
pattern="^[0-9]+\.[0-9]+\.[0-9]+-[0-9]{8}$" # This regex matches the X.X.X-YYYYMMDD pattern
14+
if [[ "${{ github.head_ref }}" == *"hotfix"* ]]; then
15+
echo "PR from a branch containing 'hotfix' is allowed."
16+
exit 0
17+
elif [[ "${{ github.head_ref }}" =~ $pattern ]]; then
18+
echo "PR from a branch matching X.X.X-YYYYMMDD pattern is allowed."
19+
exit 0
20+
else
21+
echo "PRs must come from branches containing 'hotfix' phrase or matching X.X.X-YYYYMMDD pattern."
22+
exit 1
23+
fi

.github/workflows/release-repository.yaml

+102-83
Original file line numberDiff line numberDiff line change
@@ -2,96 +2,115 @@
22
name: Release repository
33

44
on:
5-
workflow_dispatch:
6-
inputs:
7-
target_branch:
8-
description: Target branch for the release.
9-
required: true
10-
version:
11-
description: New version (used for tag and package versioning).
12-
required: true
13-
release_name:
14-
description: Name of the release to be created. Version in the first place is recommended (e.g. `2.0.0-alpha`).
15-
required: true
16-
automatic_mode:
17-
type: boolean
18-
default: false
19-
description: Automatically merge PR and create release.
20-
prerelease:
21-
type: boolean
22-
default: false
23-
description: Mark the release as a prerelease.
5+
workflow_dispatch:
6+
inputs:
7+
release_candidate:
8+
description: Branch name of the release candidate.
9+
required: true
10+
version:
11+
description: New version (used for tag and package versioning).
12+
required: true
13+
release_name:
14+
description: Name of the release to be created. Version in the first place is recommended (e.g.
15+
`2.0.0-alpha`).
16+
required: true
17+
automatic_mode:
18+
type: boolean
19+
default: false
20+
description: Automatically merge PR and create release.
21+
prerelease:
22+
type: boolean
23+
default: false
24+
description: Mark the release as a prerelease.
2425

2526
jobs:
26-
release:
27-
name: Release repository
28-
runs-on: ubuntu-22.04
29-
env:
30-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
MAIN_BRANCH: ros2
32-
steps:
33-
- name: Checkout
34-
uses: actions/checkout@v4
35-
with:
36-
ref: ${{ github.event.inputs.target_branch }}
27+
release:
28+
name: Release repository
29+
runs-on: ubuntu-22.04
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
MAIN_BRANCH: ros2
33+
DEVEL_BRANCH: ros2-devel
34+
steps:
35+
- name: Checkout to rc branch
36+
uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.release_candidate }}
3739

38-
- name: Create release candidate
39-
id: create_release_candidate
40-
uses: at-wat/catkin-release-action@v1
41-
with:
42-
version: ${{ github.event.inputs.version }}
43-
git_user: action-bot
44-
git_email: action-bot@action-bot.com
45-
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Catkin release
41+
id: catkin_release
42+
uses: at-wat/catkin-release-action@v1
43+
with:
44+
version: ${{ github.event.inputs.version }}
45+
git_user: action-bot
46+
git_email: action-bot@action-bot.com
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
4648

47-
- name: Create pull request
48-
run: |
49-
gh pr create \
50-
--base ${{ github.event.inputs.target_branch }} \
51-
--head ${{ steps.create_release_candidate.outputs.created_branch }} \
52-
--title "Release ${{ steps.create_release_candidate.outputs.version}}" \
53-
--body "This PR incorporates package(s) version and changelog update."
49+
- name: Catkin release - create PR
50+
run: |
51+
gh pr create \
52+
--base ${{ github.event.inputs.release_candidate }} \
53+
--head ${{ steps.catkin_release.outputs.created_branch }} \
54+
--title "Release ${{ steps.catkin_release.outputs.version}}" \
55+
--body "This PR incorporates package(s) version and changelog update."
5456
55-
- name: Merge pull request
56-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
57-
run: |
58-
gh pr merge ${{ steps.create_release_candidate.outputs.created_branch }} \
59-
--merge --delete-branch
57+
- name: Catkin release - merge PR
58+
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
59+
run: |
60+
gh pr merge ${{ steps.catkin_release.outputs.created_branch }} \
61+
--merge --delete-branch
6062
61-
- name: Checkout to main
62-
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
63-
uses: actions/checkout@v4
64-
with:
65-
ref: ${{ env.MAIN_BRANCH }}
63+
- name: Checkout to main branch
64+
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
65+
== true }}
66+
uses: actions/checkout@v4
67+
with:
68+
ref: ${{ env.MAIN_BRANCH }}
6669

67-
- name: Create pull request to main
68-
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
69-
run: |
70-
gh pr create \
71-
--base ${{ env.MAIN_BRANCH }} \
72-
--head ${{ github.event.inputs.target_branch }} \
73-
--title "Release ${{ steps.create_release_candidate.outputs.version}} to ${{ env.MAIN_BRANCH }}" \
74-
--body "This PR incorporates package(s) version and changelog update."
70+
- name: Create PR to main branch
71+
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
72+
== true }}
73+
run: |
74+
gh pr create \
75+
--base ${{ env.MAIN_BRANCH }} \
76+
--head ${{ github.event.inputs.release_candidate }} \
77+
--title "Release ${{ steps.catkin_release.outputs.version}} to ${{ env.MAIN_BRANCH }}" \
78+
--body "This PR incorporates package(s) version and changelog update."
7579
76-
- name: Merge pull request to main
77-
if: ${{ github.event.inputs.target_branch != env.MAIN_BRANCH && fromJSON(github.event.inputs.automatic_mode) == true }}
78-
run: |
79-
gh pr merge ${{ github.event.inputs.target_branch }} \
80-
--merge --delete-branch
80+
- name: Merge PR to main branch
81+
if: ${{ github.event.inputs.release_candidate != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode)
82+
== true }}
83+
run: |
84+
gh pr merge ${{ github.event.inputs.release_candidate }} \
85+
--merge --delete-branch
8186
82-
- name: Create prerelease
83-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == true}}
84-
run: |
85-
gh release create ${{ steps.create_release_candidate.outputs.version }} \
86-
--target ${{ env.MAIN_BRANCH }} \
87-
--title ${{ github.event.inputs.release_name }} \
88-
--generate-notes \
89-
--prerelease
87+
- name: Create prerelease
88+
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
89+
== true}}
90+
run: |
91+
gh release create ${{ steps.catkin_release.outputs.version }} \
92+
--target ${{ env.MAIN_BRANCH }} \
93+
--title ${{ github.event.inputs.release_name }} \
94+
--generate-notes \
95+
--prerelease
9096
91-
- name: Create release
92-
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease) == false}}
93-
run: |
94-
gh release create ${{ steps.create_release_candidate.outputs.version }} \
95-
--target ${{ env.MAIN_BRANCH }} \
96-
--title ${{ github.event.inputs.release_name }} \
97-
--generate-notes
97+
- name: Create release
98+
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true && fromJSON(github.event.inputs.prerelease)
99+
== false}}
100+
run: |
101+
gh release create ${{ steps.catkin_release.outputs.version }} \
102+
--target ${{ env.MAIN_BRANCH }} \
103+
--title ${{ github.event.inputs.release_name }} \
104+
--generate-notes
105+
106+
- name: Checkout to devel branch
107+
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
108+
uses: actions/checkout@v4
109+
with:
110+
ref: ${{ env.DEVEL_BRANCH }}
111+
112+
- name: Update devel branch
113+
if: ${{ env.DEVEL_BRANCH != env.MAIN_BRANCH && fromJSON(inputs.automatic_mode) == true }}
114+
run: |
115+
git pull origin ${{ env.MAIN_BRANCH }}
116+
git push origin ${{ env.DEVEL_BRANCH }}

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for package panther_msgs
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.0.3 (2024-06-06)
6+
------------------
7+
* Ros2 improve release process (`#58 <https://github.com/husarion/panther_msgs/issues/58>`_)
8+
* Contributors: Paweł Irzyk
9+
510
2.0.2 (2024-06-05)
611
------------------
712

package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>panther_msgs</name>
5-
<version>2.0.2</version>
5+
<version>2.0.3</version>
66
<description>Custom messages for Panther robot.</description>
77
<maintainer email="support@husarion.com">Husarion</maintainer>
88
<license>Apache License 2.0</license>

0 commit comments

Comments
 (0)