-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Aeliot-Tm/phar
Build PHAR file
- Loading branch information
Showing
10 changed files
with
142 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
# See https://stackoverflow.com/a/72408109 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-phar: | ||
runs-on: ubuntu-latest | ||
name: Build PHAR | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
ini-values: phar.readonly=0 | ||
tools: composer | ||
coverage: none | ||
|
||
- name: Install Composer dependencies | ||
uses: ramsey/composer-install@v3 | ||
with: | ||
composer-options: '--no-dev' | ||
|
||
- name: Build PHAR | ||
run: composer build | ||
|
||
# Smoke test. | ||
# It is recommended ot have some sorts of tests for your PHAR. | ||
#- name: Ensure the PHAR works | ||
# run: pcsf-baseline.phar --version | ||
|
||
# The following section is done only for releases | ||
- name: Import GPG key | ||
if: github.event_name == 'release' | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_KEY_83F9945BC33EC39E9710206C8B4927076BA50A83 }} | ||
passphrase: "${{ secrets.GPG_KEY_83F9945BC33EC39E9710206C8B4927076BA50A83_PASSPHRASE }}" | ||
|
||
- name: Sign the PHAR | ||
if: github.event_name == 'release' | ||
run: | | ||
gpg --local-user 83F9945BC33EC39E9710206C8B4927076BA50A83 \ | ||
--batch \ | ||
--yes \ | ||
--passphrase="${{ secrets.GPG_KEY_83F9945BC33EC39E9710206C8B4927076BA50A83_PASSPHRASE }}" \ | ||
--detach-sign \ | ||
--output pcsf-baseline.phar.asc \ | ||
pcsf-baseline.phar | ||
- name: Upload PHAR to the release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: | | ||
pcsf-baseline.phar | ||
pcsf-baseline.phar.asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.idea | ||
/.phpunit.cache/ | ||
/tools/ | ||
/vendor/ | ||
/.php-cs-fixer.cache | ||
pcsf-baseline.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="humbug/box" version="^4.6.2" installed="4.6.2" location="./tools/box.phar" copy="true"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2DF45277AEF09A2F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"alias": "pcsf-baseline.phar", | ||
"base-path": "/app/", | ||
"directories": [ | ||
"src" | ||
], | ||
"files": [ | ||
"composer.json", | ||
"composer.lock", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"finder": [ | ||
{ | ||
"name": "*.php", | ||
"exclude": [ | ||
".github", | ||
"doc", | ||
"test", | ||
"test_old", | ||
"tests", | ||
"Tests", | ||
"vendor-bin" | ||
], | ||
"in": "vendor" | ||
} | ||
], | ||
"main": "bin/pcsf-baseline", | ||
"output": "pcsf-baseline.phar" | ||
} |