如何进行版本发布
本教程详细描述了如何发布 Apache HertzBeat。
开始之前:本文中需要替换的变量
文中的命令和邮件模板使用了占位符,执行前请全部替换为你自己的值,不要直接复制粘贴。
| 占位符 | 含义 | 示例 |
|---|---|---|
{version} | 发布版本号 | 1.9.0 |
RC1 | 候选版本号,从 1 开始,每次重新投票 +1 | RC2 |
<YOUR_APACHE_ID> | 你的 Apache LDAP 用户名 | duansg |
<YOUR_APACHE_ID>@apache.org | 你的 Apache 邮箱 | duansg@apache.org |
<YOUR_KEY_ID> | 你的 GPG 短密钥 ID,gpg --keyid-format SHORT --list-keys 可查看 | EF04C474 |
<YOUR_NAME> | 邮件署名 | Duan SiGuo |
文中代码块里的命令输出示例(如 gpg 的回显、签名校验结果)保留了具体值,仅供对照格式,你实际看到的会是自己的信息。
1. 环境要求
此发布过程在 UbuntuOS(可在 Windows Mac) 中进行操作,并需要以下环境:
- JDK 25
- Node18 pnpm
- Apache Maven 3.x
- GnuPG 2.x
- Git
- SVN (Apache使用svn来托管项目发布)
注意需要设置环境变量
export GPG_TTY=$(tty)
2. 准备发布
首先整理帐户信息以更好地了解操作过程,稍后会多次使用。
- apache id:
<YOUR_APACHE_ID>(APACHE LDAP 用户名)- apache passphrase:
APACHE LDAP 密钥- apache email:
<YOUR_APACHE_ID>@apache.org- gpg real name:
<YOUR_APACHE_ID>(任何名称均可用, 建议设置为与 apache id 相同的名称)- gpg key passphrase:
创建gpg密钥时设置的密码,你需要记住此密码
2.1 生成密钥
$ gpg --full-gen-key
gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(14) Existing key from card
Your selection? 1 # Please enter 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096 # Please enter 4096 here
Requested keysize is 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
`<n>` = key expires in n days
`<n>`w = key expires in n weeks
`<n>`m = key expires in n months
`<n>`y = key expires in n years
Key is valid for? (0) 0 # Please enter 0
Key does not expire at all
Is this correct? (y/N) y # Please enter y here
GnuPG needs to construct a user ID to identify your key.
Real name: <YOUR_APACHE_ID> # Please enter 'gpg real name'
Email address: <YOUR_APACHE_ID>@apache.org # Please enter your apache email address here
Comment: apache key # Please enter some comments here
You selected this USER-ID:
"duansg (apache key) [duansg@apache.org](mailto:duansg@apache.org)"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # Please enter O here
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
# At this time, a dialog box will pop up, asking you to enter the key for this gpg.
# you need to remember that it will be used in subsequent steps.
┌─────────────────────────────────────────────────────┐
│ Please enter this passphrase to │
│ protect your new key │
│ │
│ Passphrase: _______________________________________ │
│ │
│ `<OK>` `<Cancel>` │
└─────────────────────────────────────────────────────┘
# Here you need to re-enter the password in the previous step.
┌─────────────────────────────────────────────────────┐
│ Please re-enter this passphrase │
│ │
│ Passphrase: _______________________________________ │
│ │
│ `<OK>` `<Cancel>` │
└─────────────────────────────────────────────────────┘
gpg: directory '/Users/duansg/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/Users/duansg/.gnupg/openpgp-revocs.d/C787268D3396367EB3C2242402CA7E2CEF04C474.rev'
public and secret key created and signed.
pub rsa4096 2026-07-27 [SC]
C787268D3396367EB3C2242402CA7E2CEF04C474
uid duansg <duansg@apache.org>
sub rsa4096 2026-07-27 [E]
密钥可以通过gpg --list-signatures 或者 gpg --keyid-format SHORT --list-keys 命令查看