Skip to content

Commit db092a5

Browse files
committed
update steps
1 parent 6d091b0 commit db092a5

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,31 @@ jobs:
2020
git config user.name "$GITHUB_ACTOR"
2121
git config user.email "[email protected]"
2222
23-
- name: Import GPG key
24-
id: import_gpg
25-
uses: crazy-max/ghaction-import-gpg@v6
26-
with:
27-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
28-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
23+
- name: Import GPG private key
24+
run: |
25+
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
26+
# Trust the imported key ultimately to avoid trust prompts
27+
KEY_ID=$(gpg --list-secret-keys --with-colons | grep '^sec' | head -n1 | cut -d':' -f5)
28+
echo "KEY_ID=$KEY_ID" >> $GITHUB_ENV
2929
30-
- name: Export GPG keyring for chart-releaser (GPG 2.x compatible)
30+
- name: Create combined GPG keyring for chart-releaser
3131
run: |
3232
mkdir -p gpg-keyring
33-
3433
gpg --batch --yes --pinentry-mode loopback \
3534
--passphrase "$GPG_PASSPHRASE" \
36-
--export-secret-keys "${{ steps.import_gpg.outputs.keyid }}" \
37-
> gpg-keyring/secring.gpg
38-
35+
--export-secret-keys "$KEY_ID" > gpg-keyring/combined.gpg
3936
gpg --batch --yes \
40-
--export "${{ steps.import_gpg.outputs.keyid }}" \
41-
> gpg-keyring/pubring.gpg
37+
--export "$KEY_ID" >> gpg-keyring/combined.gpg
4238
env:
4339
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
4440

4541
- name: Prepare for Chart Releaser
4642
run: |
4743
echo "$GPG_PASSPHRASE" > passphrase.txt
48-
4944
cat <<EOF > .cr.yaml
5045
sign: true
51-
key: "${{ steps.import_gpg.outputs.keyid }}"
52-
keyring: "gpg-keyring/pubring.gpg"
53-
secret-keyring: "gpg-keyring/secring.gpg"
46+
key: "$KEY_ID"
47+
keyring: "gpg-keyring/combined.gpg"
5448
passphrase-file: "passphrase.txt"
5549
EOF
5650
env:

0 commit comments

Comments
 (0)