Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions .github/RELEASE_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,11 @@ This guide explains how to set up automatic publishing to Packagist using GitHub

## How It Works

### Automatic Publishing

When a PR is merged into `main` or `master`, the release workflow will:

1. Parse the PR title using Conventional Commit style.
- Required ticket format: `type: [FEEDS-1234] description`
- Keep `feat`/`fix`/`bug` at the beginning of the title
2. Decide the bump type from the PR title (the body is not scanned):
- `feat:` => minor
- `fix:` or `bug:` => patch
- `feat!:` / `fix!:` / `<type>(scope)!:` (the `!` marker) => major
3. Update `composer.json` and `src/Constant.php` via `scripts/release/bump_version.php`
4. Commit version files, create a `vX.Y.Z` tag, create a GitHub release
5. Trigger Packagist update

### Creating a Release

1. Open a PR with a Conventional Commit style title, for example:
- `feat: [FEEDS-1350] add feed search endpoint`
- `fix: [FEEDS-1402] handle nil reaction id`
- `feat!: [FEEDS-1410] remove deprecated batch API`
2. Merge the PR into `main` or `master`.
3. GitHub Actions will automatically perform release + Packagist update.

Titles like `chore:`, `docs:`, `test:` do not trigger a release.
Releases are driven by [release-please](https://github.com/googleapis/release-please).
The Releases section of `README.md` is the reference; the short version is that merging
a PR with a conventional title updates a bot-authored Release PR, and merging that
Release PR runs the suite, creates the tag and the GitHub Release, and announces the tag
to Packagist.

### Manual Publishing (if needed)

Expand Down
62 changes: 11 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,33 @@
name: ci

# pull_request only. A push trigger alongside it ran the whole suite twice on the same
# SHA, and the duplicate integration leg raced the other run against the Stream app
# several SDK repos share. The trade is that a merge to master, and a direct push to it,
# now run nothing: release.yml runs this same workflow only when a release is pending,
# so the gate before a tag is covered but the routine post-merge signal is gone.
on:
pull_request:
push:
branches: [master, main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

permissions:
actions: write
contents: read
pull-requests: read

jobs:
check-pr-title:
name: Validate PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test:
name: 🧪 Test & lint
tests:
needs: check-pr-title
if: always() && (github.event_name != 'pull_request' || needs.check-pr-title.result == 'success')
environment: ci
runs-on: ubuntu-latest

strategy:
matrix:
php-version: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, json
tools: composer:v2

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
restore-keys: composer-${{ matrix.php-version }}-

- name: Install dependencies
run: composer install --prefer-dist --no-interaction

- name: Lint & unit tests
env:
STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
run: |
make lint
make test-unit

- name: Integration tests
if: matrix.php-version == '8.1'
env:
STREAM_API_KEY: ${{ vars.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
run: make test-integration
uses: ./.github/workflows/run_tests.yml
secrets: inherit
Loading
Loading