Skip to content

Commit

Permalink
Merge pull request #16 from tanhongit/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tanhongit authored Nov 3, 2023
2 parents 48be0fc + a7ce285 commit 4c766d0
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 26 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; This is the top-most EditorConfig file, which is not inherited by any other files.
; This file is used for unify the coding style for different editors and IDEs.
; More information at https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space

[*.json]
indent_style = space
indent_size = 2
26 changes: 26 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check & fix styling

on: [push]

permissions:
contents: write

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run PHP CS Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
23 changes: 18 additions & 5 deletions .github/workflows/setup_test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
name: Setup and test
name: Setup & test

on: [ push, pull_request ]

jobs:
tests:
name: Setup and run tests
runs-on: ubuntu-latest
name: Composer P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '8.1', '8.2' ]
laravel: [ 10.*, 9.* ]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 8.*
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: ${{ matrix.php }}

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: |
composer install --no-interaction --no-progress --no-suggest
- name: Run tests
run: |
composer validate --strict
31 changes: 31 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update Changelog

on:
release:
types: [released]

permissions:
contents: write

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ npm-debug.log

package-lock.json
yarn.lock
/.sass-cache
/.sass-cache

build
.php-cs-fixer.cache
38 changes: 38 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
37 changes: 25 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "lbiltech/laravel-telegram-git-notifier",
"name": "cslant/laravel-telegram-git-notifier",
"description": "Send notification from Gitlab and Github events to Telegram",
"keywords": [
"lbiltech",
"cslant",
"telegram-bot",
"notify",
"git-webhook",
Expand All @@ -15,7 +15,7 @@
"telegram-bot-github-notify",
"telegram-bot-gitlab-notify"
],
"homepage": "https://github.com/lbiltech/laravel-telegram-git-notifier",
"homepage": "https://github.com/cslant/laravel-telegram-git-notifier",
"license": "MIT",
"authors": [
{
Expand All @@ -32,34 +32,47 @@
],
"autoload": {
"psr-4": {
"LbilTech\\LaravelTelegramGitNotifier\\": "src/"
"CSlant\\LaravelTelegramGitNotifier\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"LbilTech\\LaravelTelegramGitNotifier\\Tests\\": "tests/"
"CSlant\\LaravelTelegramGitNotifier\\Tests\\": "tests/"
}
},
"require": {
"php": "^8.0",
"lbiltech/telegram-git-notifier": "dev-main"
"php": "^8.1",
"cslant/telegram-git-notifier": "^v1.3.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5|^10.0",
"mockery/mockery": "^1.6"
"friendsofphp/php-cs-fixer": "^v3.37.1",
"pestphp/pest": "^2.24",
"phpstan/phpstan": "^1.10.39"
},
"scripts": {
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"post-install-cmd": [
"bash vendor/cslant/telegram-git-notifier/install.sh"
],
"post-update-cmd": [
"bash vendor/cslant/telegram-git-notifier/install.sh"
]
},
"support": {
"issues": "https://github.com/lbiltech/laravel-telegram-git-notifier/issues"
"issues": "https://github.com/cslant/laravel-telegram-git-notifier/issues"
},
"extra": {
"laravel": {
"providers": [
"LbilTech\\LaravelTelegramGitNotifier\\Providers\\TelegramGitNotifierServiceProvider"
"CSlant\\LaravelTelegramGitNotifier\\Providers\\TelegramGitNotifierServiceProvider"
]
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
4 changes: 2 additions & 2 deletions config/telegram-git-notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
'author' => [
'discussion' => env(
'TGN_AUTHOR_DISCUSSION',
'https://github.com/lbiltech/laravel-telegram-git-notifier/discussions'
'https://github.com/cslant/laravel-telegram-git-notifier/discussions'
),
'source_code' => env(
'TGN_AUTHOR_SOURCE_CODE',
'https://github.com/lbiltech/laravel-telegram-git-notifier'
'https://github.com/cslant/laravel-telegram-git-notifier'
),
],

Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</include>
</coverage>
<testsuites>
<testsuite name="LbilTech Laravel Telegram Git Notify">
<testsuite name="CSlant Laravel Telegram Git Notifier">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion routes/bot.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use CSlant\LaravelTelegramGitNotifier\Http\Actions\WebhookAction;
use Illuminate\Support\Facades\Route;
use LbilTech\LaravelTelegramGitNotifier\Http\Actions\WebhookAction;

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Actions/WebhookAction.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace LbilTech\LaravelTelegramGitNotifier\Http\Actions;
namespace CSlant\LaravelTelegramGitNotifier\Http\Actions;

use LbilTech\TelegramGitNotifier\Webhook;
use CSlant\TelegramGitNotifier\Webhook;

class WebhookAction
{
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/TelegramGitNotifierServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace LbilTech\LaravelTelegramGitNotifier\Providers;
namespace CSlant\LaravelTelegramGitNotifier\Providers;

use Illuminate\Support\ServiceProvider;

Expand Down

0 comments on commit 4c766d0

Please sign in to comment.