Skip to content

Commit ceb9b08

Browse files
authored
Merge pull request #2 from php-n8n/ci-improvements
CI orchestration improvement
2 parents a75bdf4 + 411b4f0 commit ceb9b08

5 files changed

Lines changed: 74 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,21 @@ jobs:
6868
token: ${{ secrets.CODECOV_TOKEN }}
6969
slug: php-n8n/client
7070
fail_ci_if_error: true
71+
72+
dispatch-post-ci:
73+
name: Dispatch post-CI build
74+
runs-on: ubuntu-latest
75+
needs:
76+
- check
77+
- coverage
78+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
79+
80+
steps:
81+
- name: Dispatch post-CI build workflow
82+
uses: saedyousef/repository-dispatch@v0.2
83+
with:
84+
token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }}
85+
owner: ${{ github.repository_owner }}
86+
repo: ${{ github.event.repository.name }}
87+
event_type: client-ci-passed
88+
client_payload: '{"sha":"${{ github.sha }}","ref":"${{ github.ref_name }}","run_id":"${{ github.run_id }}","run_url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Post-CI Build
2+
3+
on:
4+
repository_dispatch:
5+
types:
6+
- client-ci-passed
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: Build Composer archive
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout dispatched commit
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.client_payload.sha }}
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.4'
26+
coverage: none
27+
tools: composer:v2
28+
29+
- name: Validate package metadata
30+
run: composer validate --strict
31+
32+
- name: Build Composer archive
33+
run: |
34+
mkdir -p dist
35+
composer archive --format=zip --file="dist/php-n8n-client-${{ github.event.client_payload.sha }}"
36+
37+
- name: Upload package archive
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: php-n8n-client-${{ github.event.client_payload.sha }}
41+
path: dist/*.zip
42+
if-no-files-found: error

CHANGELOG.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ https://php-n8n.com
77

88
This project follows [Semantic Versioning](https://semver.org/).
99

10-
## v1.0.0 - Unreleased
10+
## v1.0.1 - Unreleased
11+
12+
- Added post-CI repository dispatch automation using `saedyousef/repository-dispatch`.
13+
- Added a repository-dispatch receiver workflow that builds and uploads a Composer package archive after CI passes.
14+
15+
## v1.0.0 - 2026-05-10
1116

1217
- Added webhook triggering through `$client->webhooks()->trigger()`.
1318
- Added execution fetching and polling through the n8n API.
@@ -18,6 +23,4 @@ This project follows [Semantic Versioning](https://semver.org/).
1823

1924
## Release Notes
2025

21-
The first tagged release is expected to be `v1.0.0`.
22-
23-
This release establishes the initial stable public API. Future breaking changes will be reserved for major releases.
26+
`v1.0.0` establishes the initial stable public API. Future breaking changes will be reserved for major releases.

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ composer check
3838

3939
This runs Composer validation, PHPUnit, PSR-12 checks, and PHPStan.
4040

41+
## CI/CD
42+
43+
CI runs on pushes and pull requests. After the full CI and coverage jobs pass on `main`, the workflow dispatches the `client-ci-passed` repository event using `saedyousef/repository-dispatch`.
44+
45+
The dispatch job requires a `REPOSITORY_DISPATCH_TOKEN` secret with repository access. The receiver workflow listens for `client-ci-passed`, checks out the tested commit, validates Composer metadata, builds a Composer archive, and uploads it as a workflow artifact.
46+
4147
## Pull Requests
4248

4349
When contributing code:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ composer check
171171

172172
This package follows Semantic Versioning.
173173

174-
The first public tag is expected to be `v1.0.0`, marking the client API as stable from the initial release.
174+
The first public tag, `v1.0.0`, marks the client API as stable from the initial release.
175175

176176
Breaking changes will only be introduced in future major releases.
177177

0 commit comments

Comments
 (0)