Skip to content

Commit e284b10

Browse files
authored
build(fix): Fix signing the PHAR with GPG (#807)
1 parent 1c09337 commit e284b10

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,21 @@ jobs:
4848
- name: Ensure the PHAR works
4949
run: bin/php-scoper.phar --version
5050

51-
- name: Configure GPG key and sign the PHAR
51+
- name: Import GPG key
52+
uses: crazy-max/ghaction-import-gpg@v5
53+
with:
54+
gpg_private_key: ${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE }}
55+
passphrase: ${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE_PASSPHRASE }}
56+
57+
- name: Sign the PHAR
5258
run: |
53-
mkdir -p ~/.gnupg/
54-
chmod 0700 ~/.gnupg/
55-
echo "$GPG_SIGNING_KEY" > ~/.gnupg/private.key
56-
gpg --import ~/.gnupg/private.key
5759
gpg --local-user [email protected] \
5860
--batch \
5961
--yes \
60-
--passphrase="${{ secrets.GPG_KEY_161DFBE342889F01DDAC4E61CBB3D576F2A0946F_PASSPHRASE }}"
62+
--passphrase="${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE_PASSPHRASE }}"
6163
--detach-sign \
6264
--output bin/php-scoper.phar.asc \
6365
bin/php-scoper.phar
64-
env:
65-
GPG_SIGNING_KEY: |
66-
${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE }}
6766
6867
- name: Upload the PHAR artifact
6968
if: github.event_name == 'release'

0 commit comments

Comments
 (0)