Skip to content

Commit ee9ceed

Browse files
author
zhanq
committed
feat: update GPG configuration for passwordless key usage
1 parent 4bb9356 commit ee9ceed

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: crazy-max/ghaction-import-gpg@v6
3030
with:
3131
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
32-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
32+
# 使用无密码 GPG 密钥,无需配置 passphrase
3333

3434
- name: 获取版本号
3535
id: get_version

RELEASE.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,24 @@
1414

1515
#### GPG 签名相关
1616
- `GPG_PRIVATE_KEY`: GPG 私钥(完整的 ASCII 格式)
17-
- `GPG_PASSPHRASE`: GPG 私钥的密码短语
17+
18+
> **注意**:当前配置使用无密码 GPG 密钥,因此不需要配置 `GPG_PASSPHRASE`
1819
1920
### 2. GPG 密钥生成和配置
2021

2122
如果还没有 GPG 密钥,请按照以下步骤生成:
2223

2324
```bash
24-
# 生成 GPG 密钥对
25-
gpg --full-generate-key
26-
27-
# 选择:
28-
# - 密钥类型:RSA and RSA (default)
29-
# - 密钥大小:4096
30-
# - 有效期:0 (不过期) 或根据需要设置
31-
# - 输入用户信息(姓名、邮箱等)
32-
# - 设置密码短语
25+
# 当前使用方案:生成无密码的 GPG 密钥对
26+
gpg --batch --generate-key <<EOF
27+
Key-Type: RSA
28+
Key-Length: 4096
29+
Name-Real: JPush Release
30+
Name-Email: [email protected]
31+
Expire-Date: 2y
32+
%no-protection
33+
%commit
34+
EOF
3335

3436
# 查看生成的密钥
3537
gpg --list-secret-keys --keyid-format LONG

jiguang-sdk/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,12 @@
192192
<goal>sign</goal>
193193
</goals>
194194
<configuration>
195+
<!-- 无密码 GPG 密钥配置 -->
195196
<gpgArguments>
196197
<arg>--pinentry-mode</arg>
197198
<arg>loopback</arg>
199+
<arg>--batch</arg>
200+
<arg>--no-tty</arg>
198201
</gpgArguments>
199202
</configuration>
200203
</execution>

0 commit comments

Comments
 (0)