Skip to content

Commit 93fced7

Browse files
authored
Automatically published signed PHAR on release (#805)
1 parent 2d7a8c0 commit 93fced7

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

.github/workflows/build.yaml renamed to .github/workflows/release.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Release
22

33
on:
44
push:
@@ -48,11 +48,31 @@ jobs:
4848
- name: Ensure the PHAR works
4949
run: bin/php-scoper.phar --version
5050

51-
- uses: actions/upload-artifact@v3
52-
name: Upload the PHAR artifact
51+
- name: Configure GPG key and sign the PHAR
52+
run: |
53+
mkdir -p ~/.gnupg/
54+
chmod 0700 ~/.gnupg/
55+
echo "$GPG_SIGNING_KEY" > ~/.gnupg/private.key
56+
gpg --import ~/.gnupg/private.key
57+
gpg --local-user [email protected] \
58+
--batch \
59+
--yes \
60+
--passphrase="${{ secrets.GPG_KEY_161DFBE342889F01DDAC4E61CBB3D576F2A0946F_PASSPHRASE }}"
61+
--detach-sign \
62+
--output bin/php-scoper.phar.asc \
63+
bin/php-scoper.phar
64+
env:
65+
GPG_SIGNING_KEY: |
66+
${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE }}
67+
68+
- name: Upload the PHAR artifact
69+
if: github.event_name == 'release'
70+
uses: actions/upload-artifact@v3
5371
with:
5472
name: php-scoper-phar
55-
path: bin/php-scoper.phar
73+
path: |
74+
bin/php-scoper.phar
75+
bin/php-scoper.phar.asc
5676
5777
publish-phar:
5878
runs-on: ubuntu-latest
@@ -70,4 +90,6 @@ jobs:
7090
uses: softprops/action-gh-release@v1
7191
with:
7292
token: ${{ secrets.PHP_SCOPER_GITHUB_TOKEN }}
73-
files: php-scoper.phar
93+
files: |
94+
php-scoper.phar
95+
php-scoper.phar.asc

0 commit comments

Comments
 (0)