首次发布
本指南介绍如何发布您之前未发布的 ROS 2 软件包。 由于发布 ROS 软件包时有多种可用选项,本指南旨在涵盖最常见的情况,并不涵盖所有特殊情况。
B成为发布团队的一员
您必须是 发布团队 的一员。 如果您还不是发布团队的一员,请按照以下任一操作:
创建一个新的发布存储库
您需要一个 发布存储库 来发布软件包。 按照 创建一个新的发布存储库 操作。
安装依赖项
Install tools that you will use in the upcoming steps according to your platform:
sudo apt install python3-bloom python3-catkin-pkg
sudo dnf install python3-bloom python3-catkin_pkg
pip3 install -U bloom catkin_pkg
Make sure you have rosdep initialized:
sudo rosdep init
rosdep update
Note that the rosdep init
command may fail if it has already been initialized in the past; this can safely be ignored.
设置个人访问令牌
Warning
If the file ~/.config/bloom
exists on your computer, it is likely that you have done this before so you should skip this section.
During the release process, multiple HTTPS Git operations will be performed that require password authentication. To avoid being repeatedly asked for a password, a Personal Access Token (PAT) will be set up. If you have multi-factor authentication setup on your GitHub account, you must setup a Personal Access Token.
Create a Personal Access Token by:
Log in to GitHub and go to Personal access tokens.
Click the Generate new token button.
In the dropdown, select Generate new token (classic)
Set Note to something like
Bloom token
.Set Expiration to No expiration.
Tick the
public_repo
andworkflow
checkboxes.Click the Generate token button.
After you have created the token, you will end up back at the Personal access tokens page. Copy the alphanumeric token that is highlighted in green.
Save your GitHub username and PAT to a new file called ~/.config/bloom
, with the format below:
{
"github_user": "<your-github-username>",
"oauth_token": "<token-you-created-for-bloom>"
}
确保存储库是最新的
Make sure that:
Your repository is hosted on a remote such as GitHub.
You have a clone of the repository on your computer and are on the right branch.
Both the remote repository and your clone are up-to-date.
生成变更日志
使用以下命令为您的存储库中的每个软件包生成一个 CHANGELOG.rst
文件:
catkin_generate_changelog --all
Open all CHANGELOG.rst
files in an editor.
You will see that catkin_generate_changelog
has auto-generated a forthcoming section with notes from commit messages:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package your_package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Forthcoming
-----------
* you can modify this commit message
* and this
Clean up the list of commit messages to concisely convey the notable changes that have been made to the packages since the last release, and commit all the CHANGELOG.rst files.
Do not modify the Forthcoming
header.
提升软件包版本
Every release of the package must have a unique version number higher than the previous release. Run:
catkin_prepare_release
which performs the following:
increases the package version in
package.xml
replaces the heading
Forthcoming
withversion (date)
(eg.0.0.1 (2022-01-08)
) inCHANGELOG.rst
commits those changes
creates a tag (eg.
0.0.1
)pushes the changes and the tag to your remote repository
Note
By default the patch version of the package is incremented, such as from 0.0.0
to 0.0.1
.
To increment the minor or major version instead, run catkin_prepare_release --bump minor
or catkin_prepare_release --bump major
.
For more details, see catkin_prepare_release --help
.
Bloom Release
运行以下命令,将“my_repo”替换为您的存储库名称:
bloom-release --new-track --rosdistro rolling --track rolling my_repo
--new-track
告诉 bloom 创建一个新 track 并对其进行配置。--rosdistro rolling
表示此版本适用于rolling
发行版--track rolling
表示您希望轨道名称为rolling
系统将提示您输入信息以配置新轨道。 在常见情况下,例如:
您的软件包位于名为
my_repo
的存储库中您正在发布一个名为
main
的分支该存储库托管在 GitHub 上,网址为
https://github.com/my_organization/my_repo.git
您的发布存储库位于
https://github.com/ros2-gbp/my_repo-release.git
您应该按以下方式响应提示:
Configuration |
Value |
---|---|
|
|
|
|
|
|
|
|
表格中的空单元格表示应使用默认值。 只需按 Enter 键即可响应提示。
Bloom 将自动为您针对 rosdistro 创建拉取请求。
下一步
Once your pull request has been submitted, usually within one or two days, one of the maintainers of rosdistro will review and merge your Pull Request. If your package build is successful, in 24-48 hours your packages will become available in the ros-testing repository, where you can test your pre-release binaries.
Approximately every two to four weeks, the distribution’s release manager manually synchronizes the contents of ros-testing into the main ROS repository. This is when your packages actually become available to the rest of the ROS community. To get updates on when the next synchronization (sync) is coming, subscribe to the Packaging and Release Management Category on ROS Discourse.