Skip to content

Commit 06fc8a4

Browse files
authored
feat: adds release action (#17)
* feat: adds release action * fixes action * changes publish script * testing
1 parent 0c2b411 commit 06fc8a4

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release React Native SDK
2+
3+
permissions:
4+
contents: read
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js 22.x
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 22.x
20+
registry-url: "https://registry.npmjs.org"
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Build package
29+
run: |
30+
cd packages/react-native
31+
pnpm build
32+
33+
- name: Run tests
34+
run: pnpm test:coverage
35+
36+
- name: Publish to npm
37+
run: |
38+
cd packages/react-native
39+
npm publish --access public --provenance
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/react-native/src/lib/common/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export const shouldDisplayBasedOnPercentage = (
186186
displayPercentage: number
187187
): boolean => {
188188
const randomNum = Math.floor(Math.random() * 10000) / 100;
189+
189190
return randomNum <= displayPercentage;
190191
};
191192

0 commit comments

Comments
 (0)