Repository navigation
108 lines (88 loc) · 3.4 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (88 loc) · 3.4 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Build, publish & release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
# Same tarball `npm publish` would upload — gives every release a
# downloadable build artifact even before npm publishing is enabled.
- name: Pack tarball
run: npm pack
# Requires an NPM_TOKEN repo secret (npm access token with publish
# rights for the @personaliai org) — skipped automatically until set.
- name: Publish to npm
if: ${{ vars.NPM_PUBLISH_ENABLED == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: "*.tgz"
example-apk:
name: Build example app APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Build SDK
run: npm ci && npm run build
- name: Install example app dependencies
working-directory: example
run: npm install --no-audit --no-fund
# example/ is a bare Expo-managed app (no android/ios folders checked
# in) — prebuild generates a real native Android project from app.json
# so it can be built with a plain Gradle wrapper, no EAS account needed.
- name: Expo prebuild (Android)
working-directory: example
run: npx expo prebuild --platform android --no-install
- name: Configure Android SDK versions
working-directory: example/android
run: |
echo "android.minSdkVersion=24" >> gradle.properties
sed -i 's/minSdkVersion = 23/minSdkVersion = 24/g' build.gradle 2>/dev/null || true
sed -i 's/minSdkVersion 23/minSdkVersion 24/g' app/build.gradle 2>/dev/null || true
# Release (not debug) — a debug build doesn't embed the JS bundle, it
# expects a live Metro server, which produced "Could not connect to
# development server" for anyone who just installed the APK standalone.
# Release bundles JS into the APK at build time via the RN Gradle
# plugin's bundleReleaseJsAndAssets task, and Expo's generated project
# falls back to the debug keystore when no release signing config is
# set, so this still produces an installable (if not Play-signed) APK.
- name: Build release APK
working-directory: example/android
run: |
chmod +x gradlew
./gradlew assembleRelease -Pandroid.minSdkVersion=24
- name: Rename APK
run: cp example/android/app/build/outputs/apk/release/app-release.apk chatty-react-native-example.apk
- name: Attach APK to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: chatty-react-native-example.apk