Skip to content

Commit f28a60c

Browse files
committed
fix gpg key path instead of content
1 parent d57a1eb commit f28a60c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

release-rpm.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@ set -euo pipefail
55
: "${GPG_PRIVATE_KEY:?GPG_PRIVATE_KEY must be set}"
66
: "${GPG_PASSPHRASE:?GPG_PASSPHRASE must be set}"
77

8-
export GPG_PRIVATE_KEY
9-
export GPG_PASSPHRASE
8+
# Create temporary GPG key file
9+
TEMP_KEY_FILE=$(mktemp)
10+
echo "$GPG_PRIVATE_KEY" > "$TEMP_KEY_FILE"
11+
12+
# Import key into GPG keyring
13+
gpg --batch --import "$TEMP_KEY_FILE"
1014

11-
gpg --batch --import <<< "$GPG_PRIVATE_KEY"
15+
# Set environment variable for GoReleaser to use the key file path
16+
export GPG_PRIVATE_KEY="$TEMP_KEY_FILE"
17+
export GPG_PASSPHRASE
1218

1319
goreleaser release --clean --config goreleaser.rpm.yaml --snapshot
1420

21+
# Clean up
22+
rm -f "$TEMP_KEY_FILE"
23+
1524
echo "RPM build complete. Find RPMs in ./dist/"

0 commit comments

Comments
 (0)