如何发布
本文主要介绍如何发布新版本的 Apache Fury。
介绍
源代码发布是 Apache 最重视以及最重要的部分。
请注意许可证和发布的软件签名问题。发布软件是一件严肃的事情,并会产生相应的法律后果。
release manager 第一次发布
环境要求
此发布过程在 Ubuntu 系统中运行,需要以下几个环境依赖:
- JDK 1.8+
- Apache Maven 3.x+
- Python 3.8
- GnuPG 2.x
- Git
- SVN(Apache 基金会使用 svn 来托管项目发布)
- 设置环境变量:如果您在不同的目录下配置了 gpg 密钥,请执行
export GNUPGHOME=$(xxx)
导出环境变量。
准备 GPG 密钥
如果您是第一次作为软件发布者,您需要准备一个 GPG 密钥。
您可以参考这里的快速开始获取一个 GPG 密钥或者获取更多相关信息。
安装 GPG
sudo apt install gnupg2
生成 GPG 密钥
请使用您的 Apache 名字和电子邮件地址生成 GPG 密钥:
$ gpg --full-gen-key
gpg (GnuPG) 2.2.20; Copyright (C) 2020 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 # input 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096 # input 4096
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 # input 0
Key does not expire at all
Is this correct? (y/N) y # input y
GnuPG needs to construct a user ID to identify your key.
Real name: Chaokun Yang # input your name
Email address: chaokunyang@apache.org # input your email
Comment: CODE SIGNING KEY # input some annotations, optional
You selected this USER-ID:
"Chaokun <chaokunyang@apache.org>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # input O
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.
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.
# Input the security key
┌──────────────────────────────────────────────────────┐
│ Please enter this passphrase │
│ │
│ Passphrase: _______________________________ │
│ │
│ <OK> <Cancel> │
└──────────────────────────────────────────────────────┘
# key generation will be done after your inputting the key with the following output
gpg: key E49B00F626B marked as ultimately trusted
gpg: revocation certificate stored as '/Users/chaokunyang/.gnupg/openpgp-revocs.d/1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4.rev'
public and secret key created and signed.
pub rsa4096 2022-07-12 [SC]
1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4
uid [ultimate] Chaokun <chaokunyang@apache.org>
sub rsa4096 2022-07-12 [E]
上传公钥至 GPG 密钥服务器
首先,列出您所创建的 GPG 密钥:
gpg --list-keys
执行相关命令之后,您将看到如下输出:
--------------------------------------------------
pub rsa4096 2024-03-27 [SC]
1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4
uid [ultimate] chaokunyang (CODE SIGNING KEY) <chaokunyang@apache.org>
sub rsa4096 2024-03-27 [E]
然后,将您的密钥 ID 发送到密钥服务器:
gpg --keyserver keys.openpgp.org --send-key <key-id> # e.g., 1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4
其中,keys.openpgp.org
是一个随机选择的密钥服务器,可以使用 keyserver.ubuntu.com 或任何其他功能完备的密钥服务器。
检查密钥是否创建成功
上传大约需要一分钟;之后,您可以通过电子邮件在相应的密钥服务器上检查。
将密钥上传到密钥服务器的主要目的是为了加入一个可信的信任网络。
将 GPG 公钥添加到项目 KEYS 文件中
发布分支的 svn 仓库是:https://dist.apache.org/repos/dist/release/incubator/fury
请在发布分支的 KEYS 中添加公钥:
svn co https://dist.apache.org/repos/dist/release/incubator/fury fury-dist
# As this step will copy all the versions, it will take some time. If the network is broken, please use svn cleanup to delete the lock before re-execute it.
cd fury-dist
(gpg --list-sigs YOUR_NAME@apache.org && gpg --export --armor YOUR_NAME@apache.org) >> KEYS # Append your key to the KEYS file
svn add . # It is not needed if the KEYS document exists before.
svn ci -m "add gpg key for YOUR_NAME" # Later on, if you are asked to enter a username and password, just use your apache username and password.
将 GPG 公钥上传到您的 GitHub 帐户
- 输入
https://github.com/settings/keys
以添加您的 GPG 密钥。 - 如果添加后发现“未验证”字样,请将 GPG 密钥中使用的电子邮件地址绑定到您的 GitHub 帐户(https://github.com/settings/emails)。
延伸阅读
建议您在发布之前阅读以下文档,了解有关 Apache 基金会发布软件的更多详细信息,但这不是必须的:
- 发布政策:https://www.apache.org/legal/release-policy.html
- 孵化器发布:http://incubator.apache.org/guides/releasemanagement.html
- TLP 版本:https://infra.apache.org/release-distribution
- 发布标志:https://infra.apache.org/release-signing.html
- 发布发布:https://infra.apache.org/release-publishing.html
- 发布下载页面:https://infra.apache.org/release-download-pages.html
- 发布 maven artifacts:https://infra.apache.org/publishing-maven-artifacts.html
开始有关发布的讨论
通过发送电子邮件至以下地址发起有关下一个版本的讨论:dev@fury.apache.org:
标题:
[DISCUSS] Release Apache Fury(incubating) ${release_version}
内容:
Hello, Apache Fury(incubating) Community,
This is a call for a discussion to release Apache Fury(incubating) version ${release_version}.
The change lists about this release:
https://github.com/apache/fury/compare/v0.4.1...v0.5.0
Please leave your comments here about this release plan. We will bump the version in repo and start the release process after the discussion.
Thanks,
${name}