Skip to content

Commit 63761fc

Browse files
ci: add GitHub Actions workflow to publish React Native module to npm
1 parent 428d960 commit 63761fc

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 18
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
working-directory: kdownloader-react-native
24+
25+
- name: Build package
26+
run: npm run build
27+
working-directory: kdownloader-react-native
28+
29+
- name: Publish to npm
30+
run: npm publish --access public
31+
working-directory: kdownloader-react-native
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)