Skip to content

Commit 50ee29c

Browse files
chore: workflow cleanup and release process adjustments (#2663)
### 🎯 Goal - [x] created a dedicated action for setting up Node environment with own cacheing mechanism (like in `stream-chat`), this action is now used by all existing workflows - [x] adjusted `pr-title.yml` to use existing `@commitlint/cli` package (used in `commit-msg` Husky hook) - [x] adjusted how the next version is acquired - [npm publish](https://docs.npmjs.com/cli/v10/using-npm/scripts#npm-publish) runs `prepack` hook during which the next version is already defined within `package.json#version` so we can grab it from there when running build which now runs only once during the release process - [x] changed `__STREAM_CHAT_REACT_VERSION__` to `process.env.STREAM_CHAT_REACT_VERSION` which can be populated through ESBuild's `define` property, dropping `esbuild-plugin-replace`, `bundle-esm.mjs` uses this new string to replace too - [x] removed `docs_release` from the `release.yml` (not needed anymore) - [x] upgraded `actions/{cache,checkout,setup-node}` to v4 - [x] remove `docusaurus` and `docs` folders
1 parent c7ca963 commit 50ee29c

File tree

762 files changed

+393
-62001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

762 files changed

+393
-62001
lines changed

β€Ž.github/ISSUE_TEMPLATE/bug_report.mdβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: 'bug:'
55
labels: 'bug, status: unconfirmed'
66
assignees: ''
7-
87
---
98

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

1615
Steps to reproduce the behavior:
16+
1717
1. Go to '...'
1818
2. Click on '....'
1919
3. Scroll down to '....'
@@ -28,6 +28,7 @@ A clear and concise description of what you expected to happen.
2828
If applicable, add screenshots to help explain your problem.
2929

3030
**Package version**
31+
3132
- stream-chat-react:
3233
- stream-chat-css:
3334
- stream-chat-js:

β€Ž.github/ISSUE_TEMPLATE/feature_request.mdβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Describe a new feature
44
title: ''
55
labels: feature
66
assignees: ''
7-
87
---
98

109
**Motivation**
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup
2+
description: Sets up Node and installs dependencies
3+
4+
inputs:
5+
node-version:
6+
description: 'Specify Node version'
7+
required: false
8+
default: '22'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Setup Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: ${{ inputs.node-version }}
17+
18+
- name: Set NODE_VERSION env
19+
shell: bash
20+
run: echo "NODE_VERSION=$(node --version)" >> $GITHUB_ENV
21+
22+
- name: Cache dependencies
23+
uses: actions/cache@v4
24+
with:
25+
path: ./node_modules
26+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('./yarn.lock') }}
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
shell: bash

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,37 @@
11
name: Test
22

33
on: [push]
4-
env:
5-
NODE_OPTIONS: --max_old_space_size=4096
64

75
jobs:
86
tsc:
97
runs-on: ubuntu-latest
10-
name: Typescript
8+
name: TypeScript
119
steps:
12-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1311

14-
- name: πŸ’Ύ Cache Dependencies
15-
uses: actions/cache@v3
16-
with:
17-
path: ./node_modules
18-
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}
19-
20-
- name: πŸ”¨ Install Dependencies
21-
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
12+
- uses: ./.github/actions/setup-node
2213

2314
- name: πŸ§ͺ tsc
24-
run: yarn types --noEmit
15+
run: yarn types
2516

2617
test:
2718
runs-on: ubuntu-latest
28-
strategy:
29-
matrix:
30-
node: [22]
31-
name: Test with Node ${{ matrix.node }}
19+
name: Lint & test with Node
3220
steps:
33-
- uses: actions/checkout@v3
34-
- uses: actions/setup-node@v3
35-
with:
36-
node-version: ${{ matrix.node }}
37-
38-
- name: πŸ’Ύ Cache Dependencies
39-
uses: actions/cache@v3
40-
with:
41-
path: ./node_modules
42-
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}
43-
44-
- name: πŸ”¨ Install Dependencies & Build
45-
run: |
46-
yarn install --frozen-lockfile --ignore-engines
47-
yarn build
21+
- uses: actions/checkout@v4
22+
23+
- uses: ./.github/actions/setup-node
24+
25+
- name: Build SDK
26+
run: yarn build
4827

49-
- name: πŸ§ͺ Lint and Test with ${{ matrix.node }}
28+
- name: πŸ§ͺ Lint and test with Node ${{ env.NODE_VERSION }}
5029
env:
5130
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5231
run: |
5332
yarn lint
5433
yarn coverage
5534
yarn validate-translations
5635
57-
- name: πŸ§ͺ Validate CommonJS bundle with ${{ matrix.node }}
36+
- name: πŸ§ͺ Validate CommonJS bundle with Node ${{ env.NODE_VERSION }}
5837
run: yarn validate-cjs

β€Ž.github/workflows/pr-check.ymlβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ on:
55
types: [opened, edited, synchronize, reopened]
66

77
jobs:
8-
lint:
8+
pr-title:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: aslafy-z/conventional-pr-title-action@v3
12-
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
- uses: actions/checkout@v4
12+
13+
- uses: ./.github/actions/setup-node
14+
15+
- name: commitlint
16+
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,30 @@ name: Release
22
on:
33
workflow_dispatch:
44
inputs:
5-
docs_only:
6-
description: Skip package release and publish documentation only
7-
default: false
8-
type: boolean
9-
skip_docs:
10-
description: Skip publishing the documentation
11-
default: false
12-
type: boolean
135
dry_run:
14-
description: Run package release in "dry run" mode (does not publish either)
6+
description: Run package release in "dry run" mode (does not publish)
157
default: false
168
type: boolean
17-
docs_env:
18-
description: Pick environment to publish documentation to
19-
required: true
20-
type: choice
21-
default: staging
22-
options:
23-
- production
24-
- staging
259

2610
jobs:
2711
package_release:
2812
name: Release from "${{ github.ref_name }}" branch
2913
runs-on: ubuntu-latest
3014
# GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure
31-
if: ${{ !inputs.docs_only && (startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master')) }}
32-
env:
33-
NODE_OPTIONS: --max_old_space_size=4096
15+
if: ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') }}
3416
steps:
3517
- name: Checkout
36-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
3719
with:
3820
fetch-depth: 0
39-
- name: Setup Node.js
40-
uses: actions/setup-node@v3
41-
with:
42-
node-version: 20
43-
- name: Install dependencies & Build
44-
run: |
45-
yarn install --frozen-lockfile
46-
yarn run build
47-
- name: Validate CommonJS bundle
48-
run: yarn validate-cjs
21+
22+
- uses: ./.github/actions/setup-node
23+
4924
- name: Release
5025
env:
5126
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}
5428
HUSKY: 0
5529
run: >
5630
yarn semantic-release
5731
${{ inputs.dry_run && '--dry-run' || '' }}
58-
59-
docs_release:
60-
name: Publish documentation from "${{ github.ref_name }}" branch to ${{ inputs.docs_env }}
61-
runs-on: ubuntu-latest
62-
# skip during dry runs, publish to production only from master or branches with names starting with "release", publish to staging from anywhere
63-
if: ${{ !inputs.dry_run && !inputs.skip_docs && (((github.ref_name == 'master' || startsWith(github.ref_name, 'release')) && inputs.docs_env == 'production') || inputs.docs_env == 'staging') }}
64-
outputs:
65-
target-version: $${{ steps.target-version.outputs }}
66-
steps:
67-
- name: Checkout
68-
uses: actions/checkout@v3
69-
- name: Setup Node.js
70-
uses: actions/setup-node@v3
71-
with:
72-
node-version: 20
73-
- name: Install dependencies
74-
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
75-
- name: Merge shared "@stream-io/stream-chat-css" docs
76-
run: yarn docs:copy-css-docs
77-
- name: Push to stream-chat-docusaurus
78-
uses: GetStream/push-stream-chat-docusaurus-action@main
79-
with:
80-
target-branch: ${{ inputs.docs_env }}
81-
env:
82-
DOCUSAURUS_GH_TOKEN: ${{ secrets.DOCUSAURUS_GH_TOKEN }}

β€Ž.github/workflows/size.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: preactjs/compressed-size-action@v2
1919
with:
2020
repo-token: '${{ secrets.GITHUB_TOKEN }}'

β€Ž.ladle/config.mjsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// https://www.ladle.dev/docs/config
22
export default {
33
envPrefix: 'E2E_',
4-
}
4+
};

β€Ž.lintstagedrc.fix.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"src/**/*.{js,ts,tsx,md}": "eslint --fix",
3-
"{src/**/*.{js,ts,tsx,md,json}, .eslintrc.json, .prettierrc, babel.config.js}": "prettier --write"
3+
"**/*.{js,mjs,ts,mts,jsx,tsx,md,json,yml}": "prettier --write"
44
}

β€Ž.lintstagedrc.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"src/**/*.{js,ts,tsx,md}": "eslint --max-warnings 0",
3-
"{src/**/*.{js,ts,tsx,md,json}, .eslintrc.json, .prettierrc, babel.config.js}": "prettier --list-different",
3+
"**/*.{js,mjs,ts,mts,jsx,tsx,md,json,yml}": "prettier --list-different",
44
"src/i18n/*.json": "yarn run validate-translations"
55
}

0 commit comments

Comments
Β (0)