Skip to content

ci(feat): Automatically published signed PHAR on release #805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/build.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Release

on:
push:
Expand Down Expand Up @@ -48,11 +48,31 @@ jobs:
- name: Ensure the PHAR works
run: bin/php-scoper.phar --version

- uses: actions/upload-artifact@v3
name: Upload the PHAR artifact
- name: Configure GPG key and sign the PHAR
run: |
mkdir -p ~/.gnupg/
chmod 0700 ~/.gnupg/
echo "$GPG_SIGNING_KEY" > ~/.gnupg/private.key
gpg --import ~/.gnupg/private.key
gpg --local-user [email protected] \
--batch \
--yes \
--passphrase="${{ secrets.GPG_KEY_161DFBE342889F01DDAC4E61CBB3D576F2A0946F_PASSPHRASE }}"
--detach-sign \
--output bin/php-scoper.phar.asc \
bin/php-scoper.phar
env:
GPG_SIGNING_KEY: |
${{ secrets.GPG_KEY_74A754C9778AA03AA451D1C1A000F927D67184EE }}

- name: Upload the PHAR artifact
if: github.event_name == 'release'
uses: actions/upload-artifact@v3
with:
name: php-scoper-phar
path: bin/php-scoper.phar
path: |
bin/php-scoper.phar
bin/php-scoper.phar.asc

publish-phar:
runs-on: ubuntu-latest
Expand All @@ -70,4 +90,6 @@ jobs:
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.PHP_SCOPER_GITHUB_TOKEN }}
files: php-scoper.phar
files: |
php-scoper.phar
php-scoper.phar.asc