Skip to content

Commit 3bd0fcc

Browse files
authored
feat(build): add shared github action to install and build SDK (#1962)
* feat: add shared github action to install and build SDK * core: create action.yml * fix: added shell name * fix: path for sample app * chore: add description * chore: add updated yarn locks * chore: add updated yarn locks * chore: use action in all the places
1 parent 7ddce8b commit 3bd0fcc

File tree

11 files changed

+131
-125
lines changed

11 files changed

+131
-125
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'Install and Build SDK'
2+
description: 'Runs yarn install for all the packages and sample and fails if yarn lock has a change that is not committed'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install Root repo dependencies
7+
run: yarn --frozen-lockfile
8+
shell: bash
9+
- name: Install & Build the Core Package
10+
run: |
11+
cd package/
12+
yarn --frozen-lockfile
13+
shell: bash
14+
- name: Install & Build the Native Package
15+
run: |
16+
cd package/native-package/
17+
yarn --frozen-lockfile
18+
shell: bash
19+
- name: Install & Build the Expo Package
20+
run: |
21+
cd package/expo-package/
22+
yarn --frozen-lockfile
23+
shell: bash
24+
- name: Install & Build the Sample App
25+
run: |
26+
cd examples/SampleApp/
27+
yarn --frozen-lockfile
28+
shell: bash

.github/workflows/check-pr.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
node-version: [ 16.x ]
16+
node-version: [16.x]
1717
steps:
1818
- uses: actions/checkout@v3
1919
with:
@@ -23,18 +23,8 @@ jobs:
2323
uses: actions/setup-node@v3
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- name: Installation & Build Package
27-
# installation already takes care of calling prepare which calls build
28-
# for the sdk package
29-
run: |
30-
yarn --frozen-lockfile
31-
cd package/
32-
yarn --frozen-lockfile
33-
cd native-package/
34-
yarn --frozen-lockfile
35-
cd ../../examples/SampleApp/
36-
yarn --frozen-lockfile
37-
26+
- name: Install && Build - SDK and Sample App
27+
uses: ./.github/actions/install-and-build-sdk
3828
- name: Lint
3929
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
4030
- name: Test

.github/workflows/next-release.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,8 @@ jobs:
2727
run: |
2828
git config --global user.name "Steve Galili"
2929
git config --global user.email "[email protected]"
30-
- name: Installation && Build SDK
31-
run: |
32-
yarn --frozen-lockfile
33-
cd package/
34-
yarn --frozen-lockfile
35-
cd native-package/
36-
yarn --frozen-lockfile
37-
cd ../../examples/SampleApp/
38-
yarn --frozen-lockfile
39-
30+
- name: Install && Build - SDK and Sample App
31+
uses: ./.github/actions/install-and-build-sdk
4032
- name: Lint
4133
run: yarn lerna-workspaces run lint && (cd docusaurus; npx prettier --check '**/*.mdx')
4234
- name: Test

.github/workflows/release.yml

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,46 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
push:
5+
branches:
6+
- main
77

88
jobs:
9-
publish-release:
10-
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
node-version: [16.x]
14-
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
token: ${{ secrets.VERSION_BUMP_TOKEN }}
18-
# pulls all commits (needed for semantic release to correctly version)
19-
fetch-depth: '0'
20-
# pulls all tags (needed for semantic release to correctly version)
21-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v2
24-
with:
25-
node-version: ${{ matrix.node-version }}
26-
registry-url: 'https://registry.npmjs.org'
27-
- name: Prepare git
28-
run: |
29-
git config --global user.name "Steve Galili"
30-
git config --global user.email "[email protected]"
31-
- name: Installation && Build SDK
32-
run: |
33-
yarn --frozen-lockfile
34-
cd package/
35-
yarn --frozen-lockfile
36-
cd native-package/
37-
yarn --frozen-lockfile
38-
cd ../../examples/SampleApp/
39-
yarn --frozen-lockfile
40-
41-
- name: Lint
42-
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
43-
- name: Publish Release
44-
run: yarn release
45-
env:
46-
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
47-
GH_TOKEN: ${{ secrets.VERSION_BUMP_TOKEN }}
48-
- name: Merge back changes
49-
run: |
50-
git stash
51-
git checkout develop
52-
git pull origin develop
53-
git merge main -m "chore: merge back release [skip ci]"
54-
git push origin develop
9+
publish-release:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [16.x]
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
token: ${{ secrets.VERSION_BUMP_TOKEN }}
18+
# pulls all commits (needed for semantic release to correctly version)
19+
fetch-depth: '0'
20+
# pulls all tags (needed for semantic release to correctly version)
21+
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
registry-url: 'https://registry.npmjs.org'
27+
- name: Prepare git
28+
run: |
29+
git config --global user.name "Steve Galili"
30+
git config --global user.email "[email protected]"
31+
- name: Install && Build - SDK and Sample App
32+
uses: ./.github/actions/install-and-build-sdk
33+
- name: Lint
34+
run: yarn lerna-workspaces run lint && cd docusaurus && npx prettier --check '**/*.mdx'
35+
- name: Publish Release
36+
run: yarn release
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
39+
GH_TOKEN: ${{ secrets.VERSION_BUMP_TOKEN }}
40+
- name: Merge back changes
41+
run: |
42+
git stash
43+
git checkout develop
44+
git pull origin develop
45+
git merge main -m "chore: merge back release [skip ci]"
46+
git push origin develop

.github/workflows/sample-distribution.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,8 @@ jobs:
2121
with:
2222
working-directory: examples/SampleApp
2323
bundler-cache: true
24-
- name: RN setup
25-
uses: nick-invision/retry@v2
26-
with:
27-
timeout_minutes: 10
28-
max_attempts: 3
29-
command: |
30-
yarn --frozen-lockfile
31-
cd package/
32-
yarn --frozen-lockfile
33-
cd native-package/
34-
yarn --frozen-lockfile
35-
cd ../../examples/SampleApp/
36-
yarn --frozen-lockfile
37-
24+
- name: Install && Build - SDK and Sample App
25+
uses: ./.github/actions/install-and-build-sdk
3826
- name: Cache iOS pods
3927
uses: actions/cache@v2
4028
with:
@@ -71,21 +59,8 @@ jobs:
7159
distribution: 'zulu'
7260
java-version: '11'
7361
check-latest: true
74-
- name: RN setup
75-
uses: nick-invision/retry@v2
76-
with:
77-
timeout_minutes: 10
78-
max_attempts: 3
79-
command: |
80-
yarn add global react-native-cli;
81-
yarn --frozen-lockfile
82-
cd package/
83-
yarn --frozen-lockfile
84-
cd native-package/
85-
yarn --frozen-lockfile
86-
cd ../../examples/SampleApp/
87-
yarn --frozen-lockfile
88-
62+
- name: Install && Build - SDK and Sample App
63+
uses: ./.github/actions/install-and-build-sdk
8964
- name: Build
9065
run: |
9166
cd examples/SampleApp

examples/ExpoMessaging/yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6672,16 +6672,17 @@ [email protected]:
66726672
version "0.0.0"
66736673
uid ""
66746674

6675-
stream-chat-react-native-core@5.9.1:
6676-
version "5.9.1"
6677-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.9.1.tgz#c496feb6905e391505adca37c2eef25712a6e6d7"
6678-
integrity sha512-3zWEaoOHNpGAHy7qEI1PFqdx3dq3oHSpEs+PBrHYuUi8Xj7NisKWYkXkK3sa0BSn0hwcduSMZmNGOO9oo9lj2g==
6675+
stream-chat-react-native-core@5.10.0:
6676+
version "5.10.0"
6677+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.10.0.tgz#6539a878e93e56d9e04d6bb7dde63925984e5285"
6678+
integrity sha512-lJ1ON2tbSc80obGAdDHcSqzA5dtctcBy4sZ/s9AJYBOAfrQ6fw3HZhnft1YFoDg6tGJ0tOeDrwODSjlA3C4cNw==
66796679
dependencies:
66806680
"@babel/runtime" "^7.12.5"
66816681
"@gorhom/bottom-sheet" "4.4.5"
66826682
dayjs "1.10.5"
66836683
file-loader "6.2.0"
66846684
i18next "20.2.4"
6685+
linkify-it "^4.0.1"
66856686
lodash-es "4.17.21"
66866687
metro-react-native-babel-preset "0.66.2"
66876688
mime-types "^2.1.34"

examples/SampleApp/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ PODS:
553553
- React-Core
554554
- RNReactNativeHapticFeedback (1.11.0):
555555
- React-Core
556-
- RNReanimated (2.14.2):
556+
- RNReanimated (2.14.4):
557557
- DoubleConversion
558558
- FBLazyVector
559559
- FBReactNativeSpec
@@ -834,7 +834,7 @@ EXTERNAL SOURCES:
834834
SPEC CHECKSUMS:
835835
boost: a7c83b31436843459a1961bfd74b96033dc77234
836836
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
837-
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
837+
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
838838
FBLazyVector: d3cdc05875c89782840d2f38e1d6174fab24e4d2
839839
FBReactNativeSpec: 0612c8f2dbd774414bb778247c6ec6cb05aa4c50
840840
Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
@@ -855,7 +855,7 @@ SPEC CHECKSUMS:
855855
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
856856
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
857857
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
858-
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
858+
glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
859859
GoogleAppMeasurement: 4c19f031220c72464d460c9daa1fb5d1acce958e
860860
GoogleDataTransport: 1c8145da7117bd68bbbed00cf304edb6a24de00f
861861
GoogleUtilities: c2bdc4cf2ce786c4d2e6b3bcfd599a25ca78f06f
@@ -910,7 +910,7 @@ SPEC CHECKSUMS:
910910
RNImageCropPicker: ffbba608264885c241cbf3a8f78eb7aeeb978241
911911
RNNotifee: 5155e0a5e0a97d0c839030d8192783cd63053999
912912
RNReactNativeHapticFeedback: 653a8c126a0f5e88ce15ffe280b3ff37e1fbb285
913-
RNReanimated: 3ed15d2c7d7fd9d9a284de291a1e347d132d282b
913+
RNReanimated: 6668b0587bebd4b15dd849b99e5a9c70fc12ed95
914914
RNScreens: c277bfc4b5bb7c2fe977d19635df6f974f95dfd6
915915
RNShare: 755de6bac084428f8fd8fb54c376f126f40e560c
916916
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f

examples/SampleApp/yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7605,16 +7605,17 @@ [email protected]:
76057605
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
76067606
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
76077607

7608-
stream-chat-react-native-core@5.9.1:
7609-
version "5.9.1"
7610-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.9.1.tgz#c496feb6905e391505adca37c2eef25712a6e6d7"
7611-
integrity sha512-3zWEaoOHNpGAHy7qEI1PFqdx3dq3oHSpEs+PBrHYuUi8Xj7NisKWYkXkK3sa0BSn0hwcduSMZmNGOO9oo9lj2g==
7608+
stream-chat-react-native-core@5.10.0:
7609+
version "5.10.0"
7610+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.10.0.tgz#6539a878e93e56d9e04d6bb7dde63925984e5285"
7611+
integrity sha512-lJ1ON2tbSc80obGAdDHcSqzA5dtctcBy4sZ/s9AJYBOAfrQ6fw3HZhnft1YFoDg6tGJ0tOeDrwODSjlA3C4cNw==
76127612
dependencies:
76137613
"@babel/runtime" "^7.12.5"
76147614
"@gorhom/bottom-sheet" "4.4.5"
76157615
dayjs "1.10.5"
76167616
file-loader "6.2.0"
76177617
i18next "20.2.4"
7618+
linkify-it "^4.0.1"
76187619
lodash-es "4.17.21"
76197620
metro-react-native-babel-preset "0.66.2"
76207621
mime-types "^2.1.34"

examples/TypeScriptMessaging/yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7168,16 +7168,17 @@ statuses@~1.5.0:
71687168
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
71697169
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
71707170

7171-
stream-chat-react-native-core@5.9.1:
7172-
version "5.9.1"
7173-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.9.1.tgz#c496feb6905e391505adca37c2eef25712a6e6d7"
7174-
integrity sha512-3zWEaoOHNpGAHy7qEI1PFqdx3dq3oHSpEs+PBrHYuUi8Xj7NisKWYkXkK3sa0BSn0hwcduSMZmNGOO9oo9lj2g==
7171+
stream-chat-react-native-core@5.10.0:
7172+
version "5.10.0"
7173+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.10.0.tgz#6539a878e93e56d9e04d6bb7dde63925984e5285"
7174+
integrity sha512-lJ1ON2tbSc80obGAdDHcSqzA5dtctcBy4sZ/s9AJYBOAfrQ6fw3HZhnft1YFoDg6tGJ0tOeDrwODSjlA3C4cNw==
71757175
dependencies:
71767176
"@babel/runtime" "^7.12.5"
71777177
"@gorhom/bottom-sheet" "4.4.5"
71787178
dayjs "1.10.5"
71797179
file-loader "6.2.0"
71807180
i18next "20.2.4"
7181+
linkify-it "^4.0.1"
71817182
lodash-es "4.17.21"
71827183
metro-react-native-babel-preset "0.66.2"
71837184
mime-types "^2.1.34"

package/expo-package/yarn.lock

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,13 @@ lines-and-columns@^1.1.6:
23312331
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
23322332
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
23332333

2334+
linkify-it@^4.0.1:
2335+
version "4.0.1"
2336+
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec"
2337+
integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==
2338+
dependencies:
2339+
uc.micro "^1.0.1"
2340+
23342341
loader-utils@^2.0.0:
23352342
version "2.0.4"
23362343
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
@@ -2998,16 +3005,17 @@ [email protected]:
29983005
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
29993006
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
30003007

3001-
stream-chat-react-native-core@5.9.1:
3002-
version "5.9.1"
3003-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.9.1.tgz#c496feb6905e391505adca37c2eef25712a6e6d7"
3004-
integrity sha512-3zWEaoOHNpGAHy7qEI1PFqdx3dq3oHSpEs+PBrHYuUi8Xj7NisKWYkXkK3sa0BSn0hwcduSMZmNGOO9oo9lj2g==
3008+
stream-chat-react-native-core@5.10.0:
3009+
version "5.10.0"
3010+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-5.10.0.tgz#6539a878e93e56d9e04d6bb7dde63925984e5285"
3011+
integrity sha512-lJ1ON2tbSc80obGAdDHcSqzA5dtctcBy4sZ/s9AJYBOAfrQ6fw3HZhnft1YFoDg6tGJ0tOeDrwODSjlA3C4cNw==
30053012
dependencies:
30063013
"@babel/runtime" "^7.12.5"
30073014
"@gorhom/bottom-sheet" "4.4.5"
30083015
dayjs "1.10.5"
30093016
file-loader "6.2.0"
30103017
i18next "20.2.4"
3018+
linkify-it "^4.0.1"
30113019
lodash-es "4.17.21"
30123020
metro-react-native-babel-preset "0.66.2"
30133021
mime-types "^2.1.34"
@@ -3098,6 +3106,11 @@ ua-parser-js@^0.7.30:
30983106
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.32.tgz#cd8c639cdca949e30fa68c44b7813ef13e36d211"
30993107
integrity sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==
31003108

3109+
uc.micro@^1.0.1:
3110+
version "1.0.6"
3111+
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
3112+
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==
3113+
31013114
unicode-canonical-property-names-ecmascript@^2.0.0:
31023115
version "2.0.0"
31033116
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"

0 commit comments

Comments
 (0)