-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
5,134 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ end_of_line = crlf | |
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
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,3 +1,5 @@ | ||
--- | ||
|
||
# These are supported funding model platforms | ||
|
||
patreon: roxblnfk |
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,127 @@ | ||
--- | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
name: 📦 Build PHAR release | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 4 | ||
strategy: | ||
matrix: | ||
php-version: | ||
- '8.2' | ||
dependencies: | ||
- locked | ||
env: | ||
TRAP_PHAR: ".build/phar/trap.phar" | ||
TRAP_PHAR_SIGNATURE: ".build/phar/trap.phar.asc" | ||
GPG_KEYS: ".build/phar/keys.asc" | ||
GPG_KEYS_ENCRYPTED: "phar/keys.asc.gpg" | ||
steps: | ||
- name: 📦 Check out the codebase | ||
uses: actions/[email protected] | ||
|
||
- name: 🛠️ Setup PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
tools: phive | ||
|
||
- name: 🛠️ Setup problem matchers | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
- name: 🤖 Validate composer.json and composer.lock | ||
run: composer validate --ansi --strict | ||
|
||
- name: 🔍 Get composer cache directory | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
|
||
- name: ♻️ Restore cached dependencies installed with composer | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | ||
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | ||
|
||
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
with: | ||
dependencies: ${{ matrix.dependencies }} | ||
|
||
- name: 📥 Install dependencies with phive | ||
uses: wayofdev/gh-actions/actions/phive/[email protected] | ||
with: | ||
phive-home: '.phive' | ||
trust-gpg-keys: '0xC00543248C87FB13,0x033E5F8D801A2F8D,0x2DF45277AEF09A2F' | ||
|
||
- name: 🔍 Validate configuration for box-project/box | ||
run: .phive/box validate box.json.dist --ansi | ||
|
||
- name: 🤖 Compile trap.phar with box-project/box | ||
run: .phive/box compile --ansi | ||
|
||
- name: 💥 Show info about trap.phar with box-project/box | ||
run: .phive/box info ${{ env.TRAP_PHAR }} --ansi | ||
|
||
- name: 🤔 Run trap.phar help command | ||
run: ${{ env.TRAP_PHAR }} --help | ||
|
||
- name: 🔍 Show gpg version | ||
run: gpg --version | ||
|
||
- name: 🔑 Decrypt keys.asc.gpg with gpg | ||
run: gpg --batch --output ${{ env.GPG_KEYS }} --passphrase \"${{ secrets.GPG_DECRYPT_PASSPHRASE }}\" --yes --decrypt ${{ env.GPG_KEYS_ENCRYPTED }} | ||
|
||
- name: 📥 Import keys from keys.asc with gpg | ||
run: gpg --batch --import ${{ env.GPG_KEYS }} | ||
|
||
- name: 🔐 Sign trap.phar with gpg | ||
run: gpg --armor --local-user \"${{ secrets.GPG_LOCAL_USER }}\" --output ${{ env.TRAP_PHAR_SIGNATURE }} --passphrase \"${{ secrets.GPG_KEY_PASSPHRASE }}\" --pinentry-mode loopback --yes --detach-sig ${{ env.TRAP_PHAR }} | ||
|
||
- name: ❎ Remove decrypted keys.asc | ||
run: rm ${{ env.GPG_KEYS }} | ||
|
||
- name: 🏷️ Determine tag | ||
run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV" | ||
|
||
- name: 📤 Upload release assets | ||
uses: actions/[email protected] | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
script: | | ||
const fs = require("fs"); | ||
const files = [ | ||
{ | ||
name: "trap.phar", | ||
path: process.env.TRAP_PHAR, | ||
}, | ||
{ | ||
name: "trap.phar.asc", | ||
path: process.env.TRAP_PHAR_SIGNATURE, | ||
}, | ||
]; | ||
for (const file of files) { | ||
try { | ||
await github.rest.repos.uploadReleaseAsset({ | ||
data: fs.readFileSync(file.path), | ||
name: file.name, | ||
origin: process.env.RELEASE_UPLOAD_URL, | ||
owner: context.repo.owner, | ||
release_id: process.env.RELEASE_ID, | ||
repo: context.repo.repo, | ||
}); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
--- | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'bin/trap' | ||
- '.php-cs-fixer.php.dist' | ||
push: | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'bin/trap' | ||
- '.php-cs-fixer.php.dist' | ||
|
||
name: 🧹 Fix PHP coding standards | ||
|
||
jobs: | ||
coding-standards: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 4 | ||
strategy: | ||
matrix: | ||
php-version: | ||
- '8.2' | ||
dependencies: | ||
- locked | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: ⚙️ Set git to use LF line endings | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: 🛠️ Setup PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets | ||
ini-values: error_reporting=E_ALL | ||
coverage: none | ||
|
||
- name: 📦 Check out the codebase | ||
uses: actions/[email protected] | ||
|
||
- name: 🛠️ Setup problem matchers | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
- name: 🤖 Validate composer.json and composer.lock | ||
run: composer validate --ansi --strict | ||
|
||
- name: 🔍 Get composer cache directory | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
|
||
- name: ♻️ Restore cached dependencies installed with composer | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.COMPOSER_CACHE_DIR }} | ||
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }} | ||
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- | ||
|
||
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer | ||
uses: wayofdev/gh-actions/actions/composer/[email protected] | ||
with: | ||
dependencies: ${{ matrix.dependencies }} | ||
|
||
- name: 🛠️ Prepare environment | ||
run: make prepare | ||
|
||
- name: 🚨 Run coding standards task | ||
run: composer cs:diff | ||
env: | ||
PHP_CS_FIXER_IGNORE_ENV: true | ||
|
||
- name: 📤 Commit and push changed files back to GitHub | ||
uses: stefanzweifel/[email protected] | ||
with: | ||
commit_message: 'style(php-cs-fixer): lint php files and fix coding standards' | ||
branch: ${{ github.head_ref }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -2,6 +2,5 @@ | |
!/.github/ | ||
/runtime/ | ||
/vendor/ | ||
/composer.lock | ||
/.env | ||
*.log |
File renamed without changes.
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,56 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
ignore: | | ||
.build/ | ||
vendor/ | ||
bin/ | ||
rules: | ||
braces: | ||
# Defaults | ||
# min-spaces-inside: 0 | ||
# max-spaces-inside: 0 | ||
|
||
# Keep 0 min-spaces to not error on empty {} collection definitions | ||
min-spaces-inside: 0 | ||
|
||
# Allow one space inside braces to improve code readability | ||
max-spaces-inside: 1 | ||
|
||
brackets: | ||
# Defaults | ||
# min-spaces-inside: 0 | ||
# max-spaces-inside: 0 | ||
|
||
# Keep 0 min-spaces to not error on empty [] collection definitions | ||
min-spaces-inside: 0 | ||
|
||
# Allow one space inside braces to improve code readability | ||
max-spaces-inside: 1 | ||
|
||
colons: | ||
# Defaults | ||
# min-spaces-before: 0 | ||
# max-spaces-after: 1 | ||
|
||
# Allow multiple spaces after a colon to allow indentation of YAML | ||
# dictionary values | ||
max-spaces-after: -1 | ||
|
||
commas: | ||
# Defaults | ||
# max-spaces-after: 1 | ||
|
||
# Allow multiple spaces after a comma to allow indentation of YAML | ||
# dictionary values | ||
max-spaces-after: -1 | ||
|
||
comments: | ||
require-starting-space: true | ||
min-spaces-from-content: 1 | ||
|
||
line-length: disable | ||
|
||
... |
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
Oops, something went wrong.