Skip to content

Commit 5a5be21

Browse files
committed
ci: add release-please workflow for automated versioning and Packagist publishing
Pipeline: push to 1.x → tests (PHP 8.2+8.4) → release-please creates version PR → merge PR → tag created → Packagist auto-updates via webhook. Removes unused upstream Laravel workflow stubs.
1 parent 29d9db2 commit 5a5be21

6 files changed

Lines changed: 95 additions & 37 deletions

File tree

.github/workflows/issues.yml.disabled

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/pull-requests.yml.disabled

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [1.x]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
include:
18+
- php: '8.2'
19+
laravel: 12
20+
- php: '8.4'
21+
laravel: 12
22+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
path: 'sail'
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: dom, curl, libxml, mbstring, zip, fileinfo
33+
tools: composer:v2
34+
coverage: none
35+
36+
- name: Create a new Laravel application
37+
run: composer create-project laravel/laravel app "${{ matrix.laravel }}.x" --remove-vcs --no-interaction --prefer-dist
38+
39+
- name: Link Sail repository
40+
run: |
41+
composer config minimum-stability dev
42+
composer config repositories.sail path ../sail
43+
composer require reyemtech/sail:* --dev -W
44+
working-directory: app
45+
46+
- name: Install Sail
47+
run: |
48+
php artisan sail:install --php=${{ matrix.php }} --no-interaction
49+
php artisan sail:publish --no-interaction
50+
working-directory: app
51+
52+
- name: Run PHPUnit tests
53+
run: |
54+
cd ../sail && vendor/bin/phpunit
55+
working-directory: app
56+
57+
release-please:
58+
needs: test
59+
runs-on: ubuntu-latest
60+
outputs:
61+
release_created: ${{ steps.release.outputs.release_created }}
62+
tag_name: ${{ steps.release.outputs.tag_name }}
63+
version: ${{ steps.release.outputs.version }}
64+
steps:
65+
- uses: googleapis/release-please-action@v4
66+
id: release
67+
with:
68+
config-file: release-please-config.json
69+
manifest-file: .release-please-manifest.json
70+
71+
- name: Summary
72+
if: steps.release.outputs.release_created
73+
env:
74+
VERSION: ${{ steps.release.outputs.version }}
75+
TAG_NAME: ${{ steps.release.outputs.tag_name }}
76+
run: |
77+
echo "## Release Created" >> "$GITHUB_STEP_SUMMARY"
78+
echo "" >> "$GITHUB_STEP_SUMMARY"
79+
echo "- **Version:** $VERSION" >> "$GITHUB_STEP_SUMMARY"
80+
echo "- **Tag:** $TAG_NAME" >> "$GITHUB_STEP_SUMMARY"
81+
echo "- Packagist will auto-update via GitHub webhook" >> "$GITHUB_STEP_SUMMARY"

.github/workflows/update-changelog.yml.disabled

Lines changed: 0 additions & 13 deletions
This file was deleted.

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.51.1"
3+
}

release-please-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "php",
4+
"packages": {
5+
".": {
6+
"changelog-path": "CHANGELOG.md",
7+
"bump-minor-pre-major": true,
8+
"bump-patch-for-minor-pre-major": true
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)