Skip to content

Commit 46493be

Browse files
Merge pull request #107 from relaticle/chore/auto-release-ci-normalization-2x
ci: add auto-release workflow and normalize CI naming
2 parents 2b58756 + f909f55 commit 46493be

9 files changed

Lines changed: 182 additions & 25 deletions

File tree

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
labels:
9+
- "dependencies"

.github/workflows/auto-merge.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto-Merge
2+
3+
on: pull_request_target
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
9+
jobs:
10+
dependabot:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.actor == 'dependabot[bot]' }}
13+
steps:
14+
15+
- name: Dependabot metadata
16+
id: metadata
17+
uses: dependabot/fetch-metadata@v2.5.0
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: Auto-merge Dependabot PRs for semver-minor updates
22+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
23+
run: gh pr merge --auto --merge "$PR_URL"
24+
env:
25+
PR_URL: ${{github.event.pull_request.html_url}}
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Auto-merge Dependabot PRs for semver-patch updates
29+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
30+
run: gh pr merge --auto --merge "$PR_URL"
31+
env:
32+
PR_URL: ${{github.event.pull_request.html_url}}
33+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/changelog.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Changelog
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Determine target branch
16+
id: branch
17+
run: |
18+
TAG="${{ github.event.release.tag_name }}"
19+
MAJOR=$(echo "$TAG" | sed -E 's/^v?([0-9]+)\..*/\1/')
20+
BRANCH="${MAJOR}.x"
21+
if ! git ls-remote --exit-code --heads "https://github.com/${{ github.repository }}" "$BRANCH" > /dev/null 2>&1; then
22+
BRANCH="${{ github.event.repository.default_branch }}"
23+
fi
24+
echo "name=${BRANCH}" >> $GITHUB_OUTPUT
25+
26+
- name: Checkout code
27+
uses: actions/checkout@v6
28+
with:
29+
ref: ${{ steps.branch.outputs.name }}
30+
31+
- name: Update Changelog
32+
uses: stefanzweifel/changelog-updater-action@v1
33+
with:
34+
latest-version: ${{ github.event.release.name }}
35+
release-notes: ${{ github.event.release.body }}
36+
37+
- name: Commit updated CHANGELOG
38+
uses: stefanzweifel/git-auto-commit-action@v7
39+
with:
40+
branch: ${{ steps.branch.outputs.name }}
41+
commit_message: Update CHANGELOG
42+
file_pattern: CHANGELOG.md

.github/workflows/deploy-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ jobs:
6565
esac
6666
6767
- name: Checkout source branch
68-
uses: actions/checkout@v4
68+
uses: actions/checkout@v6
6969
with:
7070
ref: ${{ steps.version.outputs.branch }}
7171

7272
- name: Checkout gh-pages
73-
uses: actions/checkout@v4
73+
uses: actions/checkout@v6
7474
with:
7575
ref: gh-pages
7676
path: gh-pages
7777

7878
- name: Setup Node.js
79-
uses: actions/setup-node@v4
79+
uses: actions/setup-node@v6
8080
with:
8181
node-version: '20'
8282
cache: 'npm'

.github/workflows/pint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pint
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
php-code-styling:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v6
18+
with:
19+
ref: ${{ github.head_ref }}
20+
21+
- name: Fix PHP code style issues
22+
uses: aglipanci/laravel-pint-action@2.6
23+
24+
- name: Commit changes
25+
uses: stefanzweifel/git-auto-commit-action@v7
26+
with:
27+
commit_message: Fix styling

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
tests:
13+
uses: ./.github/workflows/tests.yml
14+
secrets: inherit
15+
16+
release:
17+
needs: tests
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v6
23+
24+
- name: Determine if pre-release
25+
id: prerelease
26+
run: |
27+
TAG="${{ github.ref_name }}"
28+
if [[ "$TAG" == *"-"* ]]; then
29+
echo "flag=--prerelease" >> $GITHUB_OUTPUT
30+
else
31+
echo "flag=" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Create GitHub Release
35+
run: gh release create "${{ github.ref_name }}" --generate-notes ${{ steps.prerelease.outputs.flag }}
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
cleanup:
40+
needs: tests
41+
if: failure()
42+
runs-on: ubuntu-latest
43+
permissions:
44+
contents: write
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v6
49+
50+
- name: Delete tag on test failure
51+
run: git push --delete origin "${{ github.ref_name }}"
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,42 @@
1-
name: run-tests
1+
name: Tests
22

33
on:
44
push:
55
branches: [2.x]
66
pull_request:
77
branches: [2.x]
8+
workflow_call:
89

910
jobs:
10-
test:
11-
runs-on: ${{ matrix.os }}
11+
tests:
12+
runs-on: ubuntu-latest
1213
strategy:
1314
fail-fast: true
1415
matrix:
15-
os: [ubuntu-latest]
1616
php: [8.4]
17-
laravel: [11.*]
17+
laravel: [12.*]
1818
stability: [prefer-stable]
1919
include:
20-
- laravel: 11.*
21-
testbench: 9.*
22-
carbon: 2.*
20+
- laravel: 12.*
21+
testbench: 10.*
2322

24-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
23+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
2524

2625
steps:
2726
- name: Checkout code
28-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2928

3029
- name: Setup PHP
3130
uses: shivammathur/setup-php@v2
3231
with:
3332
php-version: ${{ matrix.php }}
3433
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
35-
coverage: xdebug
36-
37-
- name: Setup problem matchers
38-
run: |
39-
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
40-
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
34+
coverage: none
4135

4236
- name: Install dependencies
4337
run: |
44-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
38+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4539
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4640
47-
- name: List Installed Dependencies
48-
run: composer show -D
49-
50-
- name: Execute tests
51-
run: vendor/bin/pest --ci
41+
- name: Run Pest
42+
run: vendor/bin/pest --ci

resources/lang/en/custom-fields.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
'default' => [
2525
'new_section' => 'New Section',
2626
],
27+
'notifications' => [
28+
'created' => 'Section created',
29+
],
2730
],
2831

2932
'field' => [

src/Filament/Management/Pages/CustomFieldsManagementPage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function createSectionAction(): Action
113113
])
114114
->schema(SectionForm::entityType($this->currentEntityType)->schema())
115115
->action(fn (array $data): CustomFieldSection => $this->storeSection($data))
116+
->successNotificationTitle(__('custom-fields::custom-fields.section.notifications.created'))
116117
->modalWidth(Width::TwoExtraLarge);
117118
}
118119

0 commit comments

Comments
 (0)