Skip to content

Commit

Permalink
chore: drop develop (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Oct 13, 2023
2 parents 3001ed7 + a843113 commit 799bfb0
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 62 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/docusaurus.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check PR title

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 52 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
name: Release
on:
push:
branches:
- master
- main
- beta
env:
NODE_OPTIONS: --max_old_space_size=4096
workflow_dispatch:
inputs:
docs_only:
description: Skip package release and publish documentation only
default: false
type: boolean
dry_run:
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:
release:
name: Release
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 == 'false' || github.ref_name == 'master' || github.ref_name == 'rc' || github.ref_name == 'release-v9' }}
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -28,4 +44,30 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn semantic-release
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
if: ${{ inputs.dry_run == 'false' }}
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: bash scripts/merge-stream-chat-css-docs.sh node_modules/@stream-io/stream-chat-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 }}
40 changes: 22 additions & 18 deletions developers/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# Release
# Release process (for package and documentation)

The `stream-chat-react` package follows semantic versioning and the release is to a big part automated by `semantic-release`. The utility automates:

1. Collects release notes from the commits added since the last release
2. Creates a [GitHub release](https://github.com/GetStream/stream-chat-react/releases)
3. Appends release notes to `CHANGELOG.md`
4. Publishes a new package version to NPM.
1. release notes collection from the commits added since the last release
2. [GitHub release](https://github.com/GetStream/stream-chat-react/releases) creation
3. release notes (`CHANGELOG.md`) update
4. version bump and package release to the NPM

In order to get the above generated outputs, each contributor should follow [Angular's Commit Message Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format).

## Required steps

In order the above generates correct outputs, each contributor should [Angular's Commit Messag Format rules](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format).
At the moment these manual actions have to be taken to achieve a successfull release:

At the moment these manual actions have to be taken while doing a release:
1. make sure that all the new required features and bug fixes in peer dependency repositories `@stream-io/stream-chat-css` and `stream-chat-js` are released
2. make sure that the peer dependencies `@stream-io/stream-chat-css` and `stream-chat-js` are installed at their latest version (see `package.json`, `yarn.lock`) (if applicable)
3. squash-merge required pull requests to `master` branch with appropriate message name, for example: `fix(scope): new feature`, if this feature is breaking, make sure to include `BREAKING CHANGE: <reason>` in the message footer
4. navigate to ["Actions"](https://github.com/GetStream/stream-chat-react/actions) and in the left bar select the "Release" workflow
5. click "Run workflow" and select the branch you want to release from then adjust the prompt options and click "Run workflow", note that allowed branches for __PACKAGE RELEASE__ are: `master`, `release-v9` and `rc`, there's _is no such limititation_ for the __DOCUMENTATION RELEASE__, extend the workflow condition and `.releaserc.json` as needed

0. Make sure that all the new required features and bug fixes in peer dependency repositories `@stream-io/stream-chat-css` and `stream-chat-js` are released
1. Make sure that the peer dependencies `@stream-io/stream-chat-css` and `stream-chat-js` are installed at their latest version (see `package.json`, `yarn.lock`)
2. Create a new PR request from `develop` to `master` branch.
- The PR name should correspond to the next package version that is to be released (e.g. v1.1, v8, v9.1.2). You can use GitHub's CLI utility (e.g. `gh pr create —base master`)
- The PR description should list all the changes in form of commit messages (therefore we require squashing the commit history when merging into `develop`).
3. Solve potential conflicts between the two branches
- As `master` receives updates only from `develop`, there should be no conflicts.
4. Merge the PR and make sure that:
- the `CHANGELOG.md` file has been correctly updated
- a new (correct) version of the package has been published at NPM
- a new release with correct version number has be created in GitHub
## Available release prompt options

- `docs_only` option if checked will skip the `package_release` job and will only run the `docs_release`
- `dry_run` option if checked will run the `semantic-release` command in ["dry run" mode](https://semantic-release.gitbook.io/semantic-release/usage/configuration#dryrun) and will skip `docs_release`
- `docs_env` (required) option offers two environment options to which the documentation will be pushed to via `GetStream/push-stream-chat-docusaurus-action` - defaults to `staging`

## After the release

We maintain multiple demo applications developed with `stream-chat-react`. With each new version of the package, the applications should have their dependencies upgraded explicitly in their `package.json`.

The demo apps repositories are:
Expand Down

0 comments on commit 799bfb0

Please sign in to comment.