Skip to content

Commit 655d479

Browse files
authored
Merge pull request #2 from codeat3/laravel-10-update
Laravel 10 support
2 parents ba86a18 + 1baf8e4 commit 655d479

File tree

6 files changed

+142
-11
lines changed

6 files changed

+142
-11
lines changed

.github/workflows/auto-update.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Auto Update Icons
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * 1'
6+
7+
jobs:
8+
generate:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
php: [8.0]
15+
laravel: [^8.0]
16+
17+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
with:
23+
ref: ${{ github.head_ref }}
24+
25+
- name: Read DotEnv File
26+
uses: c-py/action-dotenv-to-setenv@v2
27+
with:
28+
env-file: .env
29+
30+
- name: Checkout dependent repo
31+
uses: actions/checkout@v3
32+
with:
33+
repository: ${{ env.REPOSITORY }}
34+
ref: ${{ env.BRANCH }}
35+
path: ./dist
36+
37+
- id: latest-commit
38+
name: Get the latest commit
39+
run: |
40+
echo 'LATEST_COMMIT<<EOF' >> $GITHUB_ENV
41+
cd ./dist && git log --format="%H" -n 1 >> $GITHUB_ENV
42+
echo 'EOF' >> $GITHUB_ENV
43+
44+
- id: current-commit
45+
name: Get current commot
46+
uses: juliangruber/read-file-action@v1
47+
with:
48+
path: ./.commit
49+
50+
- name: Add versions to environment
51+
run: |
52+
echo "CURRENT_COMMIT=${{ steps.current-commit.outputs.content }}" >> $GITHUB_ENV
53+
54+
- name: Output versions
55+
run: |
56+
echo "Current commit: ${{ env.CURRENT_COMMIT }}"
57+
echo "Latest commit: ${{ env.LATEST_COMMIT }}"
58+
59+
- name: Install dependencies
60+
run: composer update --no-interaction --no-progress --dev
61+
62+
- name: Compile icons to resources directory
63+
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
64+
run: ./vendor/bin/blade-icons-generate
65+
66+
- name: Update commit hash in ".commit"
67+
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
68+
run: echo ${{ env.LATEST_COMMIT }}>./.commit
69+
70+
- name: Create PR for latest version
71+
if: env.CURRENT_COMMIT != env.LATEST_COMMIT
72+
uses: peter-evans/create-pull-request@v3
73+
with:
74+
commit-message: "auto-update: update icons with the latest commit ${{ env.LATEST_COMMIT }}"
75+
committer: GitHub Action <[email protected]>
76+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
77+
title: "chore: update icons with the latest commit v${{ env.LATEST_COMMIT }}"
78+
body: |
79+
This updates from [${{ env.CURRENT_COMMIT }}](https://github.com/${{ env.REPOSITORY }}/commit/${{ env.CURRENT_COMMIT }}) to [${{ env.LATEST_COMMIT }}](https://github.com/${{ env.REPOSITORY }}/commit/${{ env.LATEST_COMMIT }}).
80+
Check out the differences: [`${{ env.CURRENT_COMMIT }}` ... `${{ env.LATEST_COMMIT }}`](https://github.com/${{ env.REPOSITORY }}/compare/${{ env.CURRENT_COMMIT }}...${{ env.LATEST_COMMIT }})
81+
branch: feature/update-${{ env.LATEST_COMMIT }}
82+

.github/workflows/php-cs-fixer.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
php: [8.0]
13+
laravel: [^8.0]
14+
15+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
with:
21+
ref: ${{ github.head_ref }}
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
extensions: dom, curl, libxml, mbstring, zip
28+
coverage: none
29+
30+
- name: Install dependencies
31+
run: composer update --prefer-dist --no-interaction --no-progress
32+
33+
- name: Run PHP CS Fixer
34+
run: vendor/bin/php-cs-fixer fix
35+
36+
- name: Commit changes
37+
uses: stefanzweifel/git-auto-commit-action@v4
38+
with:
39+
commit_message: Fix styling
40+
41+

.github/workflows/tests.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,24 @@ jobs:
1111
strategy:
1212
fail-fast: true
1313
matrix:
14-
php: [7.4, '8.0', 8.1]
15-
laravel: [8, 9]
14+
php: [7.4, '8.0', 8.1, 8.2]
15+
laravel: [8, 9, 10]
1616
exclude:
1717
- php: 7.4
1818
laravel: 9
19+
- php: 7.4
20+
laravel: 10
21+
- php: '8.0'
22+
laravel: 10
23+
- php: 8.2
24+
laravel: 8
1925

2026
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
2127

2228

2329
steps:
2430
- name: Checkout code
25-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
2632

2733
- name: Setup PHP
2834
uses: shivammathur/setup-php@v2
@@ -38,3 +44,4 @@ jobs:
3844
3945
- name: Execute tests
4046
run: vendor/bin/phpunit --verbose
47+

.github/workflows/update-changelog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
with:
1515
ref: main
1616

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
"require": {
1818
"php": "^7.4|^8.0",
1919
"blade-ui-kit/blade-icons": "^1.1",
20-
"illuminate/support": "^8.0|^9.0"
20+
"illuminate/support": "^8.0|^9.0|^10.0"
2121
},
2222
"require-dev": {
23+
"codeat3/blade-icon-generation-helpers": "^0.3",
2324
"codeat3/phpcs-styles": "^1.0",
24-
"orchestra/testbench": "^6.0|^7.0",
25+
"orchestra/testbench": "^6.0|^7.0|^8.0",
2526
"phpunit/phpunit": "^9.0"
2627
},
2728
"autoload": {

src/BladeMicronsServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace Codeat3\BladeMicrons;
66

77
use BladeUI\Icons\Factory;
8-
use Illuminate\Support\ServiceProvider;
98
use Illuminate\Contracts\Container\Container;
9+
use Illuminate\Support\ServiceProvider;
1010

1111
final class BladeMicronsServiceProvider extends ServiceProvider
1212
{
@@ -17,24 +17,24 @@ public function register(): void
1717
$this->callAfterResolving(Factory::class, function (Factory $factory, Container $container) {
1818
$config = $container->make('config')->get('blade-microns', []);
1919

20-
$factory->add('microns', array_merge(['path' => __DIR__.'/../resources/svg'], $config));
20+
$factory->add('microns', array_merge(['path' => __DIR__ . '/../resources/svg'], $config));
2121
});
2222
}
2323

2424
private function registerConfig(): void
2525
{
26-
$this->mergeConfigFrom(__DIR__.'/../config/blade-microns.php', 'blade-microns');
26+
$this->mergeConfigFrom(__DIR__ . '/../config/blade-microns.php', 'blade-microns');
2727
}
2828

2929
public function boot(): void
3030
{
3131
if ($this->app->runningInConsole()) {
3232
$this->publishes([
33-
__DIR__.'/../resources/svg' => public_path('vendor/blade-microns'),
33+
__DIR__ . '/../resources/svg' => public_path('vendor/blade-microns'),
3434
], 'blade-microns');
3535

3636
$this->publishes([
37-
__DIR__.'/../config/blade-microns.php' => $this->app->configPath('blade-microns.php'),
37+
__DIR__ . '/../config/blade-microns.php' => $this->app->configPath('blade-microns.php'),
3838
], 'blade-microns-config');
3939
}
4040
}

0 commit comments

Comments
 (0)