Skip to content

chore: workflow cleanup and release process adjustments #2663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 7, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: 'bug:'
labels: 'bug, status: unconfirmed'
assignees: ''

---

**Describe the bug**
Expand All @@ -14,6 +13,7 @@ A clear and concise description of what the bug is.
**To Reproduce**

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -28,6 +28,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Package version**

- stream-chat-react:
- stream-chat-css:
- stream-chat-js:
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Describe a new feature
title: ''
labels: feature
assignees: ''

---

**Motivation**
Expand Down
30 changes: 30 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Setup
description: Sets up Node and installs dependencies

inputs:
node-version:
description: 'Specify Node version'
required: false
default: '22'

runs:
using: 'composite'
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Set NODE_VERSION env
shell: bash
run: echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('./yarn.lock') }}

- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash
47 changes: 13 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,37 @@
name: Test

on: [push]
env:
NODE_OPTIONS: --max_old_space_size=4096

jobs:
tsc:
runs-on: ubuntu-latest
name: Typescript
name: TypeScript
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: 💾 Cache Dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: 🔨 Install Dependencies
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
- uses: ./.github/actions/setup-node

- name: 🧪 tsc
run: yarn types --noEmit
run: yarn types

test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [22]
name: Test with Node ${{ matrix.node }}
name: Lint & test with Node
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: 💾 Cache Dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: 🔨 Install Dependencies & Build
run: |
yarn install --frozen-lockfile --ignore-engines
yarn build
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-node

- name: Build SDK
run: yarn build

- name: 🧪 Lint and Test with ${{ matrix.node }}
- name: 🧪 Lint and test with Node ${{ env.NODE_VERSION }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
yarn lint
yarn coverage
yarn validate-translations

- name: 🧪 Validate CommonJS bundle with ${{ matrix.node }}
- name: 🧪 Validate CommonJS bundle with Node ${{ env.NODE_VERSION }}
run: yarn validate-cjs
11 changes: 7 additions & 4 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ on:
types: [opened, edited, synchronize, reopened]

jobs:
lint:
pr-title:
runs-on: ubuntu-latest
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-node

- name: commitlint
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose
65 changes: 7 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,30 @@ name: Release
on:
workflow_dispatch:
inputs:
docs_only:
description: Skip package release and publish documentation only
default: false
type: boolean
skip_docs:
description: Skip publishing the documentation
default: false
type: boolean
dry_run:
description: Run package release in "dry run" mode (does not publish either)
description: Run package release in "dry run" mode (does not publish)
default: false
type: boolean
docs_env:
description: Pick environment to publish documentation to
required: true
type: choice
default: staging
options:
- production
- staging

jobs:
package_release:
name: Release from "${{ github.ref_name }}" branch
runs-on: ubuntu-latest
# GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure
if: ${{ !inputs.docs_only && (startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master')) }}
env:
NODE_OPTIONS: --max_old_space_size=4096
if: ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies & Build
run: |
yarn install --frozen-lockfile
yarn run build
- name: Validate CommonJS bundle
run: yarn validate-cjs

- uses: ./.github/actions/setup-node

- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
HUSKY: 0
run: >
yarn semantic-release
${{ inputs.dry_run && '--dry-run' || '' }}

docs_release:
name: Publish documentation from "${{ github.ref_name }}" branch to ${{ inputs.docs_env }}
runs-on: ubuntu-latest
# skip during dry runs, publish to production only from master or branches with names starting with "release", publish to staging from anywhere
if: ${{ !inputs.dry_run && !inputs.skip_docs && (((github.ref_name == 'master' || startsWith(github.ref_name, 'release')) && inputs.docs_env == 'production') || inputs.docs_env == 'staging') }}
outputs:
target-version: $${{ steps.target-version.outputs }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
- name: Merge shared "@stream-io/stream-chat-css" docs
run: yarn docs:copy-css-docs
- name: Push to stream-chat-docusaurus
uses: GetStream/push-stream-chat-docusaurus-action@main
with:
target-branch: ${{ inputs.docs_env }}
env:
DOCUSAURUS_GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
2 changes: 1 addition & 1 deletion .ladle/config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://www.ladle.dev/docs/config
export default {
envPrefix: 'E2E_',
}
};
2 changes: 1 addition & 1 deletion .lintstagedrc.fix.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"src/**/*.{js,ts,tsx,md}": "eslint --fix",
"{src/**/*.{js,ts,tsx,md,json}, .eslintrc.json, .prettierrc, babel.config.js}": "prettier --write"
"**/*.{js,mjs,ts,mts,jsx,tsx,md,json,yml}": "prettier --write"
}
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"src/**/*.{js,ts,tsx,md}": "eslint --max-warnings 0",
"{src/**/*.{js,ts,tsx,md,json}, .eslintrc.json, .prettierrc, babel.config.js}": "prettier --list-different",
"**/*.{js,mjs,ts,mts,jsx,tsx,md,json,yml}": "prettier --list-different",
"src/i18n/*.json": "yarn run validate-translations"
}
17 changes: 4 additions & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
node_modules
/.cache/
/public/static/styles.js
examples/*/src/serviceWorker.js
src/stream-emoji.json
/dist/
/lib/
/bin/
/include/
/build/
build
*.md
src/components/docs/
node_modules/
CHANGELOG.md
examples/**/serviceWorker.ts
./dist/
6 changes: 0 additions & 6 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
}
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build"
}
],
[
"@semantic-release/changelog",
{
Expand Down
29 changes: 19 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,46 @@ As a contributor, here are the guidelines we would like you to follow:
- [Submission Guidelines](#submission-guidelines)
- [Signing the CLA](#contributor-licence-agreement)


## <a name="asking-questions"></a>Are you looking for answers?

There are many ways you can get your questions answered. It can be hard to decide, where to begin if you are just starting out. We suggest you take a look at the resources in the following order:

### 1. Stream chat API documentation
Package `stream-chat-react` has a peer dependency [stream-chat-js](https://github.com/GetStream/stream-chat-js) - a client library for interacting with the Stream Chat API (see the [API docs](https://getstream.io/chat/docs/javascript/?language=javascript)).

Package `stream-chat-react` has a peer dependency [stream-chat-js](https://github.com/GetStream/stream-chat-js) - a client library for interacting with the Stream Chat API (see the [API docs](https://getstream.io/chat/docs/javascript/?language=javascript)).

### 2. Documentation for stream-chat-react

The [stream-chat-react](https://getstream.io/chat/docs/sdk/react/) documentation is held separately from the Stream Chat API docs. Besides documenting the component API, it provides examples of their use in various scenarios.

### 3. Read the source code

When you plan on contributing to the repository try to get acquainted with the existing code base. The best way to learn :)

### 4. Take a look at our tutorials


### Get help from our Customer Success team
If what you are looking for is technical support embedding Stream in your application, we suggest emailing our Customer Success team at support@getstream.io with your application key and the SDK versions you're using. The Issue section of this GitHub repo is now reserved only for bug reports, feature improvements and suggestions.

If what you are looking for is technical support embedding Stream in your application, we suggest emailing our Customer Success team at support@getstream.io with your application key and the SDK versions you're using. The Issue section of this GitHub repo is now reserved only for bug reports, feature improvements and suggestions.

## <a name="filing-an-issue"></a>Filing an issue
Spotting imperfections and not keeping them to yourself is the first step to make this library better. We are very grateful for reports concerning imperfections in the source code or the [documentation]((https://getstream.io/chat/docs/sdk/react/)). Before filing an issue, please, review the list of [open issues](https://github.com/GetStream/stream-chat-react/issues) first.

Spotting imperfections and not keeping them to yourself is the first step to make this library better. We are very grateful for reports concerning imperfections in the source code or the [documentation](<(https://getstream.io/chat/docs/sdk/react/)>). Before filing an issue, please, review the list of [open issues](https://github.com/GetStream/stream-chat-react/issues) first.

### Reporting bugs
You can report a source code bug by using the [Bug Report template](https://github.com/GetStream/stream-chat-react/issues/new/choose). Make sure you include "steps to reproduce" section. Bug that cannot be reproduced cannot be solved.

Do not be afraid to report imperfections in our [documentation]((https://getstream.io/chat/docs/sdk/react/)) as well. In such case, please attach the `docs` tag to the issue.
You can report a source code bug by using the [Bug Report template](https://github.com/GetStream/stream-chat-react/issues/new/choose). Make sure you include "steps to reproduce" section. Bug that cannot be reproduced cannot be solved.

Do not be afraid to report imperfections in our [documentation](<(https://getstream.io/chat/docs/sdk/react/)>) as well. In such case, please attach the `docs` tag to the issue.

### Requesting a feature

You can request a feature by submitting a [Feature request issue](https://github.com/GetStream/stream-chat-react/issues/new?assignees=&labels=feature&template=feature_request.md&title=) in our repository. If you would like to implement the proposal, please state it in the issue. It will allow us to discuss the proposal and better coordinate the efforts. You can even ping us - mention `@GetStream/stream-react-developers ` in the issue.

## <a name="contribution-standards"></a> Contributing to the repo

### Set up for success

It is always good to get acquainted with the specifics of the package. For example the `stream-chat-react` package has its peer dependencies (`stream-chat-js`, `stream-chat-css`), which you may need to tweak at the same time, while developing the feature for `stream-chat-react`. To get more into those specifics, please read [development guide](./developers/DEVELOPMENT.md).

### Good first issue
Expand All @@ -51,28 +56,32 @@ It is always good to get acquainted with the specifics of the package. For examp
Any contributions to the library should follow Stream's coding rules.

#### 1. Code should be tested

All the code submitted should be covered by unit tests. Mocking utilities are provided in `src/mock-builders`. Optimally a suite of E2E tests should be included as well.

#### 2. API Changes should be documented

Changes to components interface exposed to the library integrators should be documented. We keep the documentation `docusaurus/docs/React` folder. Please see the [dedicated documentation guide](./developers/DOCUMENTATION.md) for more information on how to maintain our documentation.

#### 3. Code should be DRY & correctly formatted

If you find yourself copying source code from one place to another, please extract it into a separate component or function.

#### 4. Keep an eye on performance

Keep in mind that the chat application may need to work with thousands of messages.

#### 5. Follow commit formatting rules
We follow [Angular's Commit Message Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format) with [possible deviations](./developers/COMMIT.md). The same rules are used by our release automation tool. Therefore, every commit message should strictly comply with these rules.

We follow [Angular's Commit Message Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format) with [possible deviations](./developers/COMMIT.md). The same rules are used by our release automation tool. Therefore, every commit message should strictly comply with these rules.

## <a name="submission-guidelines"></a> Submitting your work

1. Make sure you have signed our Contributor License agreement
2. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the repo and create a dedicated git branch locally
3. Follow the [coding rules](#coding-rules)
4. Create a descriptive PR ([see more on PR requirements](./developers/PR_REVIEW.md))


## <a name="contributor-licence-agreement"></a> Contributor License Agreement
Before we can merge your contribution into our repository, we would like to ask you to sign the [Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform).

Before we can merge your contribution into our repository, we would like to ask you to sign the [Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform).
Loading