Skip to content

Commit 1eec517

Browse files
authored
Merge pull request #748 from GetStream/develop
Next release
2 parents 6526579 + ba9da09 commit 1eec517

26 files changed

+1677
-457
lines changed

.github/workflows/changelog-preview.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,35 @@ jobs:
1313
- uses: actions/checkout@v2
1414
with:
1515
ref: develop
16-
# pulls all commits (needed for lerna / semantic release to correctly version)
16+
# pulls all commits (needed for semantic release to correctly version)
1717
fetch-depth: '0'
18-
# pulls all tags (needed for lerna / semantic release to correctly version)
18+
# pulls all tags (needed for semantic release to correctly version)
1919
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2020
- name: Use Node.js ${{ matrix.node-version }}
2121
uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
registry-url: 'https://registry.npmjs.org'
2525
- name: Installation
26-
run: yarn && yarn lerna exec yarn install
26+
run: yarn --frozen-lockfile && yarn bootstrap-ci
2727
- name: Generate Changelog
2828
id: generate_changelog
2929
run: |
30-
yarn lerna version prerelease --conventional-commits --conventional-prerelease --preid rc --no-git-tag-version --no-push --yes
31-
CHANGELOG_PREVIEW=$(bash ./extractVersionChanges.sh)
32-
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW//'%'/'%25'}"
33-
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\n'/'%0A'}"
34-
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\r'/'%0D'}"
30+
GITHUB_REF='refs/heads/develop' yarn extract-changelog
31+
echo "Changelog script finished! Checking if there are changes..."
32+
CHANGELOG_PREVIEW=$(cat NEXT_RELEASE_CHANGELOG.md || true)
3533
3634
if [[ ! -z "${CHANGELOG_PREVIEW}" ]]; then
35+
echo "Changelog found! Writing header to the file..."
36+
echo '# Next releases' | cat - NEXT_RELEASE_CHANGELOG.md > NEXT_RELEASE_CHANGELOG.tmp.md && mv NEXT_RELEASE_CHANGELOG.tmp.md NEXT_RELEASE_CHANGELOG.md
37+
38+
echo "Changelog file ready! Setting up outputs"
39+
CHANGELOG_PREVIEW=$(cat NEXT_RELEASE_CHANGELOG.md)
40+
41+
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW//'%'/'%25'}"
42+
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\n'/'%0A'}"
43+
CHANGELOG_PREVIEW_ESCAPED="${CHANGELOG_PREVIEW_ESCAPED//$'\r'/'%0D'}"
44+
3745
echo "::set-output name=exists::true"
3846
echo "::set-output name=preview::$CHANGELOG_PREVIEW_ESCAPED"
3947
fi

.github/workflows/next-release.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- develop
7-
paths:
8-
- package/**
97

108
jobs:
119
publish-next:
@@ -16,9 +14,9 @@ jobs:
1614
steps:
1715
- uses: actions/checkout@v2
1816
with:
19-
# pulls all commits (needed for lerna / semantic release to correctly version)
17+
# pulls all commits (needed for semantic release to correctly version)
2018
fetch-depth: '0'
21-
# pulls all tags (needed for lerna / semantic release to correctly version)
19+
# pulls all tags (needed for semantic release to correctly version)
2220
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2321
- name: Use Node.js ${{ matrix.node-version }}
2422
uses: actions/setup-node@v2
@@ -30,11 +28,10 @@ jobs:
3028
git config --global user.name "Vishal Narkhede"
3129
git config --global user.email "[email protected]"
3230
- name: Installation
33-
run: yarn && yarn lerna exec yarn install
31+
run: yarn --frozen-lockfile && yarn bootstrap-ci
3432
- name: Lint
35-
run: yarn lerna exec yarn lint-fix
36-
- name: Publish Next release
37-
run: |
38-
yarn lerna publish prerelease --conventional-commits --conventional-prerelease --no-private --no-push --no-git-tag-version --dist-tag next --preid next.${GITHUB_SHA::7} --no-verify-access --force-publish="*" --yes
33+
run: yarn lerna-workspaces run lint-fix
34+
- name: Publish Next Release
35+
run: GITHUB_SHORT_SHA="$(git rev-parse --short $GITHUB_SHA)" yarn release-next
3936
env:
4037
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

.github/workflows/release-candidate.yml renamed to .github/workflows/rc-release.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ on:
66
- master
77

88
jobs:
9-
publish-release-candidate:
9+
publish-rc:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
1313
node-version: [12.x]
1414
steps:
1515
- uses: actions/checkout@v2
1616
with:
17-
# pulls all commits (needed for lerna / semantic release to correctly version)
17+
# pulls all commits (needed for semantic release to correctly version)
1818
fetch-depth: '0'
19-
token: ${{ secrets.VERSION_BUMP_TOKEN }}
20-
# pulls all tags (needed for lerna / semantic release to correctly version)
19+
# pulls all tags (needed for semantic release to correctly version)
2120
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2221
- name: Use Node.js ${{ matrix.node-version }}
2322
uses: actions/setup-node@v2
@@ -29,12 +28,11 @@ jobs:
2928
git config --global user.name "Vishal Narkhede"
3029
git config --global user.email "[email protected]"
3130
- name: Installation
32-
run: yarn --frozen-lockfile && yarn lerna exec "yarn install --frozen-lockfile"
31+
run: yarn --frozen-lockfile && yarn bootstrap-ci
3332
- name: Lint
34-
run: yarn lerna exec yarn lint-fix
33+
run: yarn lerna-workspaces run lint-fix
3534
- name: Publish Release Candidate
36-
run: |
37-
yarn lerna publish prerelease --conventional-commits --conventional-prerelease --preid rc --dist-tag rc --no-verify-access --yes
35+
run: yarn release-rc
3836
env:
3937
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
4038
GH_TOKEN: ${{ secrets.VERSION_BUMP_TOKEN }}

.github/workflows/release.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
with:
15-
# pulls all commits (needed for lerna / semantic release to correctly version)
16-
ref: master
15+
# pulls all commits (needed for semantic release to correctly version)
1716
fetch-depth: '0'
18-
token: ${{ secrets.VERSION_BUMP_TOKEN }}
19-
# pulls all tags (needed for lerna / semantic release to correctly version)
17+
# pulls all tags (needed for semantic release to correctly version)
2018
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2119
- name: Use Node.js ${{ matrix.node-version }}
2220
uses: actions/setup-node@v2
@@ -28,29 +26,14 @@ jobs:
2826
git config --global user.name "Vishal Narkhede"
2927
git config --global user.email "[email protected]"
3028
- name: Installation
31-
run: yarn --frozen-lockfile && yarn lerna exec "yarn install --frozen-lockfile"
29+
run: yarn --frozen-lockfile && yarn bootstrap-ci
3230
- name: Lint
33-
run: yarn lerna exec yarn lint-fix
34-
- name: Publish release
35-
run: |
36-
yarn lerna publish --conventional-commits --conventional-graduate --create-release github --no-verify-access --yes
31+
run: yarn lerna-workspaces run lint-fix
32+
- name: Publish Release
33+
run: yarn release
3734
env:
3835
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
3936
GH_TOKEN: ${{ secrets.VERSION_BUMP_TOKEN }}
40-
- name: Extract latest SDK tag
41-
id: extract_tags
42-
run: |
43-
GENERATED_SDK_TAG=$(git describe --match "stream-chat-react-native-core@*" --abbrev=0 --tags)
44-
PARSED_SDK_TAG="v$(echo "$GENERATED_SDK_TAG" | sed -e 's/stream-chat-react-native-core@//g')"
45-
echo "::set-output name=tag::$GENERATED_SDK_TAG"
46-
echo "::set-output name=newtag::$PARSED_SDK_TAG"
47-
- name: Rename release
48-
uses: meeDamian/[email protected]
49-
with:
50-
token: ${{ secrets.VERSION_BUMP_TOKEN }}
51-
tag: ${{ steps.extract_tags.outputs.tag }}
52-
name: ${{ steps.extract_tags.outputs.newtag }}
53-
allow_override: true
5437
- name: Merge back changes
5538
run: |
5639
git stash

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
NEXT_RELEASE_CHANGELOG.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ We welcome code changes that improve this library or fix a problem, and please m
168168
169169
## Git flow & Release process
170170
171-
We enforce conventional commits and have an automated releasing process using lerna. Read our [git flow & release process guide](https://github.com/GetStream/stream-chat-react-native/blob/master/RELEASE_PROCESS.md) for more information
171+
We enforce conventional commits and have an automated releasing process using workspaces and semantic-release. Read our [git flow & release process guide](https://github.com/GetStream/stream-chat-react-native/blob/master/RELEASE_PROCESS.md) for more information
172172
173173
## We are hiring
174174

RELEASE_PROCESS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Release process
22

3-
## Lerna
3+
## Workspaces & semantic-release
44

5-
We use lerna to manage the release process for our SDK and SampleApp. It has an option for conventional commits and we use it on every commit and pull request
6-
title so we can have automatically generated tags and changelogs.
5+
We use workspaces and semantic-release to manage the release process for our SDK and SampleApp. It enforces conventional commits on every commit and pull request title so we can have automatically generated tags and changelogs.
76

87
## Angular conventional commits
98

@@ -12,7 +11,7 @@ Also, we enforce that our pull request titles follow the spec because we only co
1211

1312
## Creating breaking changes
1413

15-
Please follow [the spec](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#commit-message-with-description-and-breaking-change-in-body) when adding breaking changes. Have in mind that the `!` in the commit message is not really supported from lerna yet so avoid that and just add the `BREAKING CHANGE:` flag to the commit body. As explained in the last section, you have two ways to trigger breaking changes: On commit level and on pull request level. The recommended is to do it at commit level in order to be more specific on whats breaking and which commits is generating the breaking change, but if thats not possible for some reason, you need to add it to the pull request merge body.
14+
Please follow [the spec](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#commit-message-with-description-and-breaking-change-in-body) when adding breaking changes. Have in mind that the `!` in the commit message is not really supported yet so avoid that and just add the `BREAKING CHANGE:` flag to the commit body. As explained in the last section, you have two ways to trigger breaking changes: On commit level and on pull request level. The recommended is to do it at commit level in order to be more specific on whats breaking and which commits is generating the breaking change, but if thats not possible for some reason, you need to add it to the pull request merge body.
1615

1716
![image](https://user-images.githubusercontent.com/18744505/124764512-69f17c00-df0b-11eb-9747-c46127fba32d.png)
1817

changelog-preset.config.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

dotgit/hooks/pre-commit-format.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -e
44

5-
if ! yarn lerna run lint; then
6-
yarn lerna run lint-fix
5+
if ! yarn lerna-workspaces run lint; then
6+
yarn lerna-workspaces run lint-fix
77
echo "some files were not formatted correctly (prettier/eslint) commit aborted!"
88
echo "your changes are still staged, you can accept formatting changes with git add or ignore them by adding --no-verify to git commit"
99
exit 1

examples/SampleApp/CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Change Log
22

3-
All notable changes to this project will be documented in this file.
4-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5-
63
## [0.0.25](https://github.com/GetStream/stream-chat-react-native/compare/[email protected]@0.0.25) (2021-07-13)
74

85
**Note:** Version bump only for package SampleApp

0 commit comments

Comments
 (0)