Skip to content

Commit 4b88dfd

Browse files
Added application compilation
1 parent c3649fc commit 4b88dfd

File tree

14 files changed

+3369
-3266
lines changed

14 files changed

+3369
-3266
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
.gitattributes export-ignore
77
.gitignore export-ignore
88

9-
.env.example export-ignore
10-
119
README.md export-ignore

.github/workflows/build.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build application
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag version'
8+
required: true
9+
10+
permissions: write-all
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Extract the tag version
18+
id: tag
19+
run: |
20+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
21+
GITHUB_REF=${{ github.event.inputs.tag }}
22+
fi
23+
echo "tag=${GITHUB_REF##*v}" >> "$GITHUB_OUTPUT"
24+
25+
- name: Checkout the code
26+
uses: actions/checkout@v4
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
32+
ini-values: error_reporting=E_ALL
33+
coverage: xdebug
34+
35+
- name: Install the dependencies
36+
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
37+
38+
- name: Run tests
39+
run: composer test
40+
41+
- name: Create the PHAR file
42+
run: php ./notifications app:build notifications --build-version=${{ steps.tag.outputs.tag }} --ansi
43+
44+
- name: Upload artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: notifications
48+
path: builds/notifications
49+
retention-days: 30
50+
51+
checks:
52+
runs-on: ubuntu-latest
53+
54+
needs: build
55+
56+
strategy:
57+
fail-fast: true
58+
matrix:
59+
php: [ "8.2", "8.3" ]
60+
61+
name: PHP ${{ matrix.php }}
62+
63+
steps:
64+
- name: Setup PHP
65+
uses: shivammathur/setup-php@v2
66+
with:
67+
php-version: ${{ matrix.php }}
68+
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, json, dom, curl, libxml, fileinfo, tokenizer, xml
69+
coverage: xdebug
70+
71+
- name: Remove old file
72+
run: rm -f builds/notifications
73+
74+
- uses: actions/download-artifact@v4
75+
with:
76+
name: notifications
77+
path: builds
78+
79+
- name: Show version
80+
run: php builds/notifications --version
81+
82+
- name: Run tests
83+
run: composer test
84+
85+
push:
86+
runs-on: ubuntu-latest
87+
88+
needs: checks
89+
90+
steps:
91+
- name: Checkout the code
92+
uses: actions/checkout@v4
93+
94+
- name: Remove old file
95+
run: rm -f builds/notifications
96+
97+
- uses: actions/download-artifact@v4
98+
with:
99+
name: notifications
100+
path: builds
101+
102+
- name: Push changes
103+
uses: ad-m/github-push-action@master
104+
if: steps.build.outputs.is_dirty == 1
105+
with:
106+
github_token: ${{ secrets.COMPOSER_TOKEN }}
107+
108+
- name: Create a Pull Request
109+
uses: peter-evans/create-pull-request@v6
110+
with:
111+
branch: app
112+
branch-suffix: random
113+
delete-branch: true
114+
add-paths: ./builds/notifications
115+
title: "🏗️ Build application"
116+
commit-message: 🏗️ Build application
117+
body: Application compiled successfully
118+
labels: build

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
coverage: xdebug
2727

2828
- name: Install dependencies
29-
run: composer update
29+
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
3030

3131
- name: Execute tests
3232
run: composer test

box.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"chmod": "0755",
3+
"directories": [
4+
"app",
5+
"bootstrap",
6+
"config",
7+
"vendor"
8+
],
9+
"files": [
10+
"composer.json"
11+
],
12+
"exclude-composer-files": false,
13+
"exclude-dev-files": false,
14+
"compression": "GZ",
15+
"compactors": [
16+
"KevinGH\\Box\\Compactor\\Php",
17+
"KevinGH\\Box\\Compactor\\Json"
18+
]
19+
}

builds/notifications

7.03 MB
Binary file not shown.

composer.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@
3131
"source": "https://github.com/TheDragonCode/github-notifications"
3232
},
3333
"require": {
34-
"php": "^8.2",
35-
"ext-json": "*",
36-
"guzzlehttp/guzzle": "^7.8",
37-
"knplabs/github-api": "^3.14",
38-
"laravel-zero/framework": "^10.2"
34+
"php": "^8.2"
3935
},
4036
"require-dev": {
41-
"mockery/mockery": "^1.6",
42-
"pestphp/pest": "^2.22"
37+
"guzzlehttp/guzzle": "^7.8.1",
38+
"knplabs/github-api": "^3.14.1",
39+
"laravel-zero/framework": "^10.3",
40+
"mockery/mockery": "^1.6.11",
41+
"pestphp/pest": "^2.34.6"
4342
},
4443
"minimum-stability": "stable",
4544
"prefer-stable": true,
@@ -54,7 +53,7 @@
5453
}
5554
},
5655
"bin": [
57-
"bin/notifications"
56+
"builds/notifications"
5857
],
5958
"config": {
6059
"allow-plugins": {
@@ -68,9 +67,6 @@
6867
"preferred-install": "dist",
6968
"sort-packages": true
7069
},
71-
"extra": {
72-
"bin-dir": "bin"
73-
},
7470
"scripts": {
7571
"test": [
7672
"@php vendor/bin/pest --compact"

0 commit comments

Comments
 (0)