Skip to content

Commit cbcbf8f

Browse files
committed
fix: optimize build times + add ios builds
1 parent 468924e commit cbcbf8f

4 files changed

Lines changed: 101 additions & 5 deletions

File tree

.github/workflows/release-ios.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release iOS (TestFlight)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
profile:
7+
description: "EAS build profile"
8+
required: true
9+
default: "production"
10+
type: choice
11+
options:
12+
- production
13+
- preview
14+
15+
jobs:
16+
build-and-submit:
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: pnpm/action-setup@v4
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: pnpm
27+
28+
- uses: expo/expo-github-action@v8
29+
with:
30+
eas-version: latest
31+
token: ${{ secrets.EXPO_TOKEN }}
32+
33+
- name: Cache CocoaPods
34+
uses: actions/cache@v4
35+
with:
36+
path: ios/Pods
37+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-pods-
40+
41+
- run: pnpm install
42+
43+
- name: Build iOS
44+
run: eas build --platform ios --profile ${{ inputs.profile }} --local --output ./thoughtbook.ipa
45+
46+
- name: Submit to TestFlight
47+
run: eas submit --platform ios --path ./thoughtbook.ipa --profile production

.github/workflows/release.yml

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release APK
1+
name: Release
22

33
on:
44
push:
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1517

1618
- uses: pnpm/action-setup@v4
1719

@@ -20,17 +22,58 @@ jobs:
2022
node-version: 22
2123
cache: pnpm
2224

25+
- uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: 17
29+
2330
- uses: expo/expo-github-action@v8
2431
with:
2532
eas-version: latest
2633
token: ${{ secrets.EXPO_TOKEN }}
2734

35+
- name: Cache Gradle dependencies
36+
uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.gradle/caches
40+
~/.gradle/wrapper
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-gradle-
44+
2845
- run: pnpm install
2946

3047
- run: eas build --platform android --profile preview --local --output ./thoughtbook.apk
3148

49+
- name: Generate Release Notes
50+
run: |
51+
PREV_TAG=$(git tag --sort=-creatordate | sed -n '2p')
52+
CURRENT_TAG=${GITHUB_REF#refs/tags/}
53+
54+
if [ -z "$PREV_TAG" ]; then
55+
COMMITS=$(git log --pretty=format:"- %s (%an)" $CURRENT_TAG)
56+
else
57+
COMMITS=$(git log --pretty=format:"- %s (%an)" ${PREV_TAG}..${CURRENT_TAG})
58+
fi
59+
60+
if [ -z "$PREV_TAG" ]; then
61+
AUTHORS=$(git log --pretty=format:"%an" $CURRENT_TAG | sort -u | sed 's/^/@/' | paste -sd ", " -)
62+
else
63+
AUTHORS=$(git log --pretty=format:"%an" ${PREV_TAG}..${CURRENT_TAG} | sort -u | sed 's/^/@/' | paste -sd ", " -)
64+
fi
65+
66+
{
67+
echo "## What's Changed"
68+
echo ""
69+
echo "$COMMITS"
70+
echo ""
71+
echo "## Contributors"
72+
echo "$AUTHORS"
73+
} > release_notes.md
74+
3275
- name: Upload APK to Release
3376
uses: softprops/action-gh-release@v2
3477
with:
3578
files: ./thoughtbook.apk
36-
generate_release_notes: true
79+
body_path: release_notes.md

app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"newArchEnabled": true,
1111
"ios": {
1212
"supportsTablet": true,
13-
"bundleIdentifier": "com.anonymous.thoughtbook",
13+
"bundleIdentifier": "com.devshetty.thoughtbook",
1414
"infoPlist": {
1515
"ITSAppUsesNonExemptEncryption": false
1616
}
@@ -24,7 +24,7 @@
2424
},
2525
"edgeToEdgeEnabled": true,
2626
"predictiveBackGestureEnabled": false,
27-
"package": "com.anonymous.thoughtbook"
27+
"package": "com.devshetty.thoughtbook"
2828
},
2929
"web": {
3030
"output": "static",

eas.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
"preview": {
1212
"distribution": "internal",
1313
"android": {
14-
"buildType": "apk"
14+
"buildType": "apk",
15+
"gradleCommand": ":app:assembleRelease -PreactNativeArchitectures=arm64-v8a"
16+
},
17+
"env": {
18+
"ORG_GRADLE_PROJECT_android.enableMinifyInReleaseBuilds": "true",
19+
"ORG_GRADLE_PROJECT_android.enableShrinkResourcesInReleaseBuilds": "true",
20+
"ORG_GRADLE_PROJECT_android.enableBundleCompression": "true"
1521
}
1622
},
1723
"production": {

0 commit comments

Comments
 (0)