-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (43 loc) · 1.34 KB
/
generate-bundle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Generate and Deploy JS Bundle
on:
push:
branches:
- release
workflow_dispatch:
jobs:
generate-bundle:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
# Step 3: Install dependencies
- name: Install dependencies
run: npm install
# Step 4: Generate the JavaScript bundle
- name: Generate JS bundle
run: |
mkdir -p dist
npx react-native bundle \
--platform android \
--dev false \
--entry-file index.js \
--bundle-output dist/index.android.bundle \
--assets-dest dist/
# Step 5: Upload or Replace the Release
- name: Create or Replace GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: dist/index.android.bundle
tag: static-release
releaseName: "Static JS Bundle Release"
body: "This release contains the latest JavaScript bundle for React Native."
draft: false
prerelease: false
replace: true # Allow replacing the release if it already exists