Skip to content
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

Upgrade #2

Merged
merged 16 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
806 changes: 806 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
name: Code Style

on:
push:
pull_request:
on: [ push, pull_request ]

permissions: write-all

jobs:
check:
if: ${{ ! (github.event_name == 'push' && github.ref == 'refs/heads/main') }}

uses: TheDragonCode/.github/.github/workflows/code-style.yml@main
with:
token: ${{ secrets.COMPOSER_TOKEN }}
fix: false

fix:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

uses: TheDragonCode/.github/.github/workflows/code-style.yml@main
with:
token: ${{ secrets.COMPOSER_TOKEN }}
fix: true
style:
runs-on: ubuntu-latest

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

- name: Detect job name
id: detect
run: |
[[ ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} ]] && NAME="Fix" || NAME="Check"

echo "name=${NAME}" >> $GITHUB_OUTPUT

- name: ${{ steps.detect.outputs.name }} the code style
uses: TheDragonCode/codestyler@v3
with:
github_token: ${{ secrets.COMPOSER_TOKEN }}
fix: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
65 changes: 26 additions & 39 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,29 @@ name: Tests
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "8.1", "8.2" ]
laravel: [ "9.0", "10.0" ]

name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: default
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
coverage: none

- name: Install dependencies
run: composer require laravel/framework:^${{ matrix.laravel }}

- name: Execute tests
run: sudo vendor/bin/phpunit
env:
MYSQL_HOST: 127.0.0.1
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "8.1", "8.2" ]

name: PHP ${{ matrix.php }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
coverage: none

- name: Install dependencies
run: composer install

- name: Execute tests
run: sudo vendor/bin/phpunit
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
coverage: none

- name: Resolve version
id: tag
run: |
Expand Down
50 changes: 37 additions & 13 deletions .github/workflows/split.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
name: Split

on:
# push:
# branches:
# - main
# - 4.x
workflow_dispatch:
push:
branches:
- main
- 4.x
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
components:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
persist-credentials: 'false'

- name: Components release
run: ./bin/split.sh
- name: Extract branch name
id: extract_branch
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT

- uses: frankdejonge/use-github-token@1.0.1
with:
authentication: '${{ secrets.COMPOSER_USERNAME }}:${{ secrets.COMPOSER_TOKEN }}'
user_name: 'Andrey Helldar'
user_email: 'helldar@dragon-code.pro'

- name: Cache splitsh-lite
id: splitsh-cache
uses: actions/cache@v2
with:
path: './.splitsh'
key: '${{ runner.os }}-splitsh-d-101'

- name: Extract components
uses: frankdejonge/use-subsplit-publish@1.0.0-beta.7
with:
source-branch: ${{ steps.extract_branch.outputs.branch }}
splitsh-path: './.splitsh/splitsh-lite'
config-path: split.json
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.idea/

build/
node_modules/
vendor/
tmp/

.env
http-client.private.env.json

*.bak
*.cache
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
[![Total Downloads][badge_downloads]][link_packagist]
[![License][badge_license]][link_license]

> Coming soon
> The project is undergoing a global upgrade.
>
> We will soon release version 4.0 for all our products 💪


[badge_downloads]: https://img.shields.io/packagist/dt/cashier-provider/core.svg?style=flat-square
Expand Down
1 change: 0 additions & 1 deletion bin/.gitignore

This file was deleted.

8 changes: 3 additions & 5 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ then
exit 1
fi

RELEASE_BRANCH="4.x"
RELEASE_BRANCH="main"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
VERSION=$1

Expand Down Expand Up @@ -52,17 +52,15 @@ git tag $VERSION
git push origin --tags

# Tag Components
# sber-online temporairy disabled to release
for REMOTE in core \
cash \
sber-auth \
sber-online \
sber-qr \
tinkoff-auth \
tinkoff-credit \
tinkoff-online \
tinkoff-qr \
driver \
driver-auth
tinkoff-qr
do
echo ""
echo ""
Expand Down
3 changes: 3 additions & 0 deletions bin/split.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ function split()

git pull origin $CURRENT_BRANCH

split 'docs' docs

split 'src/Core' core
split 'src/Cash' cash
split 'src/SberAuth' sber-auth
Expand All @@ -26,5 +28,6 @@ split 'src/TinkoffAuth' tinkoff-auth
split 'src/TinkoffCredit' tinkoff-credit
split 'src/TinkoffOnline' tinkoff-online
split 'src/TinkoffQrCode' tinkoff-qr

split 'src/TemplateDriver' driver
split 'src/TemplateDriverAuth' driver-auth
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"cashier-provider/cash": "self.version",
"cashier-provider/core": "self.version",
"cashier-provider/sber-auth": "self.version",
"cashier-provider/sber-online": "self.version",
"cashier-provider/sber-qr": "self.version",
"cashier-provider/tinkoff-auth": "self.version",
"cashier-provider/tinkoff-credit": "self.version",
Expand All @@ -71,17 +70,17 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"CashierProvider\\BankName\\Auth\\": "src/TemplateDriverAuth/src/",
"CashierProvider\\BankName\\PaymentType\\": "src/TemplateDriver/src/",
"CashierProvider\\Cash\\": "src/Cash/src/",
"CashierProvider\\Core\\": "src/Core/src/",
"CashierProvider\\Sber\\Auth\\": "src/SberAuth/src/",
"CashierProvider\\Sber\\Online\\": "src/SberOnline/src/",
"CashierProvider\\Sber\\QrCode\\": "src/SberQrCode/src/",
"CashierProvider\\Tinkoff\\Auth\\": "src/TinkoffAuth/src/",
"CashierProvider\\Tinkoff\\Online\\": "src/TinkoffOnline/src/",
"CashierProvider\\Tinkoff\\QrCode\\": "src/TinkoffQrCode/src/",
"CashierProvider\\Tinkoff\\Credit\\": "src/TinkoffCredit/src/",
"CashierProvider\\BankName\\PaymentType\\": "src/TemplateDriver/src/",
"CashierProvider\\BankName\\Auth\\": "src/TemplateDriverAuth/src/"
"CashierProvider\\Tinkoff\\Online\\": "src/TinkoffOnline/src/",
"CashierProvider\\Tinkoff\\QrCode\\": "src/TinkoffQrCode/src/"
}
},
"autoload-dev": {
Expand Down
3 changes: 3 additions & 0 deletions docs/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: TheDragonCode
open_collective: dragon-code
custom: [ "https://boosty.to/dragon-code", "https://yoomoney.ru/to/410012608840929" ]
7 changes: 7 additions & 0 deletions docs/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
-
package-ecosystem: github-actions
directory: /
schedule:
interval: daily
13 changes: 13 additions & 0 deletions docs/.github/workflows/close-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close Pull Request

on:
pull_request_target:
types: [ opened ]

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for your pull request. However, you have submitted this PR on the Cashier Provider organization which is a read-only sub split of `cashier-provider/foundation`. Please submit your PR on the https://github.com/cashier-provider/foundation repository.<br><br>Thanks!"
25 changes: 25 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Cashier Provider Documentation

<img src="https://preview.dragon-code.pro/cashier-provider/payments.svg?brand=laravel&mode=dark" alt="Cashier Provider Foundation"/>

[![Stable Version][badge_stable]][link_packagist]
[![Unstable Version][badge_unstable]][link_packagist]
[![Total Downloads][badge_downloads]][link_packagist]
[![License][badge_license]][link_license]

> The project is undergoing a global upgrade.
>
> We will soon release version 4.0 for all our products 💪


[badge_downloads]: https://img.shields.io/packagist/dt/cashier-provider/core.svg?style=flat-square

[badge_license]: https://img.shields.io/packagist/l/cashier-provider/core.svg?style=flat-square

[badge_stable]: https://img.shields.io/github/v/release/cashier-provider/core?label=stable&style=flat-square

[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square

[link_license]: LICENSE

[link_packagist]: https://packagist.org/packages/cashier-provider/core
5 changes: 5 additions & 0 deletions http-client.env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dev": {
"name": "value"
}
}
Loading
Loading