Skip to content

Commit 7a51b2d

Browse files
authored
Simplify GPG signing process in release workflow
Removed unnecessary GPG configuration and signing steps from the release workflow.
1 parent a6f429a commit 7a51b2d

1 file changed

Lines changed: 19 additions & 31 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,44 +99,32 @@ jobs:
9999
PPA_GPG_PASSPHRASE: ${{ secrets.PPA_GPG_PASSPHRASE }}
100100
DEBEMAIL: ${{ secrets.LAUNCHPAD_EMAIL }}
101101
DEBFULLNAME: ${{ secrets.GPG_FULL_NAME }}
102-
DEBSIGN_KEYID: ${{ secrets.GPG_KEY_ID }}
103-
DEBSIGN_GPGOPTS: "--batch --yes --pinentry-mode loopback --passphrase=${{ secrets.PPA_GPG_PASSPHRASE }}"
104102
UBUNTU_DIST: ${{ matrix.dist }}
105103
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
106104
if: env.GPG_PRIVATE_KEY != ''
107105
run: |
108-
export GNUPGHOME=$RUNNER_TEMP/gnupg
109-
mkdir -p "$GNUPGHOME"
110-
chmod 700 "$GNUPGHOME"
111-
# Configure gpg-agent for non-interactive loopback pinentry
112-
echo 'allow-loopback-pinentry' > "$GNUPGHOME/gpg-agent.conf"
113-
echo 'pinentry-mode loopback' > "$GNUPGHOME/gpg.conf"
114-
gpgconf --kill gpg-agent || true
115-
# Import ASCII-armored PRIVATE key (must begin with BEGIN PGP PRIVATE KEY BLOCK)
116-
echo "$GPG_PRIVATE_KEY" | gpg --batch --yes --import
117-
echo "Imported keys (secret):"
118-
gpg --list-secret-keys --keyid-format LONG || true
119-
# Fail fast if no secret keys are present (public key only won't work)
120-
if ! gpg --list-secret-keys --keyid-format LONG | grep -q 'sec'; then
121-
echo "ERROR: No secret key was imported. Ensure secrets.GPG_PRIVATE_KEY contains your ASCII-armored PRIVATE key (not just the public key)." >&2
122-
exit 1
123-
fi
124-
# Quick signing self-test to validate passphrase + loopback work
125-
echo test > /tmp/gpgtest.txt
126-
gpg --batch --yes \
127-
--pinentry-mode loopback \
106+
export GNUPGHOME="$RUNNER_TEMP/gnupg"
107+
108+
# Build unsigned source package (-us -uc)
109+
debuild -S -sa -d -us -uc
110+
111+
# Sign manually to avoid debsign problems on GitHub Actions
112+
DSC=$(ls ../*.dsc)
113+
CHG=$(ls ../*.changes)
114+
115+
echo "Signing $DSC"
116+
gpg --batch --yes --pinentry-mode loopback \
128117
--passphrase "$PPA_GPG_PASSPHRASE" \
129118
-u "$GPG_KEY_ID" \
130-
-a \
131-
-s \
132-
-o /tmp/gpgtest.txt.asc \
133-
/tmp/gpgtest.txt
134-
echo "GNUPGHOME=$GNUPGHOME" >> $GITHUB_ENV
119+
--detach-sign --armor "$DSC"
135120
136-
# -S for source-only, -sa to include full orig, -d to skip local Build-Depends check
137-
export GNUPGHOME="$RUNNER_TEMP/gnupg"
138-
debuild -S -sa -d
139-
ls -l ../*.changes
121+
echo "Signing $CHG"
122+
gpg --batch --yes --pinentry-mode loopback \
123+
--passphrase "$PPA_GPG_PASSPHRASE" \
124+
-u "$GPG_KEY_ID" \
125+
--detach-sign --armor "$CHG"
126+
127+
ls -l ../*
140128
141129
- name: Upload to Launchpad PPA
142130
env:

0 commit comments

Comments
 (0)