File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed
Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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+ 31+ Expire-Date: 2y
32+ %no-protection
33+ %commit
34+ EOF
3335
3436# 查看生成的密钥
3537gpg --list-secret-keys --keyid-format LONG
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments