Skip to content

Commit 29bdff0

Browse files
author
yuzelin
committed
set gpg
1 parent 93c3462 commit 29bdff0

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/create-source-release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,19 @@ jobs:
2626
- name: Checkout code
2727
uses: actions/checkout@v2
2828

29+
- name: Setup GPG
30+
run: |
31+
mkdir -p ~/.gnupg
32+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import --yes
33+
echo "use-agent" >> ~/.gnupg/gpg.conf
34+
echo "pinentry-program /usr/bin/pinentry" >> ~/.gnupg/gpg-agent.conf
35+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
36+
2937
- name: Create source release
3038
run: |
3139
mkdir -p output
3240
chmod +x tools/releasing/create_source_release.sh
33-
OUTPUT_DIR=output tools/releasing/create_source_release.sh
41+
OUTPUT_DIR=output GPG_PASSPHRASE=${{ secrets.GPG_PASSPHRASE }} tools/releasing/create_source_release.sh
3442
3543
- name: Upload source release
3644
uses: actions/upload-artifact@v4

tools/releasing/create_source_release.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@
1818
#
1919

2020
##
21-
## set output directory
21+
## set build vars
2222
##
2323
OUTPUT_DIR=${OUTPUT_DIR}
24+
GPG_PASSPHRASE=${GPG_PASSPHRASE}
2425

2526
if [ -z "${OUTPUT_DIR}" ]; then
2627
echo "OUTPUT_DIR was not set"
2728
exit 1
2829
fi
2930

31+
if [ -z "${GPG_PASSPHRASE}" ]; then
32+
echo "GPG_PASSPHRASE was not set"
33+
exit 1
34+
fi
35+
3036
# fail immediately
3137
set -o errexit
3238
set -o nounset
@@ -88,7 +94,7 @@ cp "dist/${WHEEL_FILE_NAME}" "${OUTPUT_DIR}/${WHEEL_FILE_NAME}"
8894
cd ${OUTPUT_DIR}
8995

9096
# Sign sha the wheel package
91-
gpg --armor --detach-sig ${WHEEL_FILE_NAME}
97+
gpg --batch --yes --pinentry-mode loopback --passphrase=GPG_PASSPHRASE --armor --detach-sign --armor ${WHEEL_FILE_NAME}
9298
$SHASUM ${WHEEL_FILE_NAME} > "${WHEEL_FILE_NAME}.sha512"
9399

94100
rm -rf DEPS_DIR

0 commit comments

Comments
 (0)