Skip to content

Commit aaf4a17

Browse files
authored
Merge pull request #4 from amarjanica/feature/with-play-internal-test-track
add android build to ci
2 parents e9f07ad + 3f8d8a8 commit aaf4a17

File tree

7 files changed

+151
-15
lines changed

7 files changed

+151
-15
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Setup Expo"
2+
description: "Sets up java 17 and expo env"
3+
4+
inputs:
5+
expo-token:
6+
description: 'Expo Token'
7+
required: true
8+
default: ''
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
# To avoid the error: _GRADLEW] > Could not resolve com.google.firebase:firebase-crashlytics-gradle:3.0.0.
14+
#[RUN_GRADLEW] Required by:
15+
#[RUN_GRADLEW] project :
16+
#[RUN_GRADLEW] > Dependency requires at least JVM runtime version 17. This build uses a Java 11 JVM.
17+
- name: Set up Java 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '17'
21+
distribution: 'adopt'
22+
- name: 🏗 Setup EAS
23+
uses: expo/expo-github-action@v8
24+
with:
25+
expo-version: latest
26+
eas-version: latest
27+
token: ${{ inputs.expo-token }}
28+
packager: npm
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Setup Node environment"
2+
description: "Checkout, cache and npm install"
3+
4+
inputs:
5+
node-version:
6+
description: 'The Node.js version to use'
7+
required: true
8+
default: '18'
9+
cache-path:
10+
description: 'The path to cache node modules'
11+
required: true
12+
cache-key:
13+
description: 'The key for caching'
14+
required: true
15+
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ inputs.node-version }}
23+
- name: Cache Node modules
24+
uses: actions/cache@v4
25+
with:
26+
path: ${{ inputs.cache-path }}
27+
key: ${{ inputs.cache-key }}

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- name: Use Node.js
16-
uses: actions/setup-node@v4
17-
with:
18-
node-version: 20
19-
- run: npm ci
20-
- run: npm test
14+
- uses: actions/checkout@v4
15+
- uses: ./.github/actions/setup-node-environment
16+
with:
17+
node-version: '20'
18+
cache-path: 'node_modules'
19+
cache-key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
20+
- run: npm ci
21+
- run: npm test

.github/workflows/release-dev.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release DEV
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: ./.github/actions/setup-node-environment
12+
with:
13+
node-version: '20'
14+
cache-path: 'node_modules'
15+
cache-key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
16+
- uses: ./.github/actions/setup-expo
17+
with:
18+
expo-token: ${{ secrets.EXPO_TOKEN }}
19+
- name: Install dependencies
20+
run: npm i
21+
- name: Build development
22+
run: npm run build:android-dev
23+
- name: Create GitHub Release
24+
uses: actions/create-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: v${{ github.run_number }}
29+
release_name: Snapshot Release v${{ github.run_number }} - ${{ github.ref_name }}
30+
body: |
31+
WIP development pre-release
32+
draft: false
33+
prerelease: true
34+
- name: Upload apk to GitHub Release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: gh release upload v${{ github.run_number }} ./app/app-dev.apk
38+

.github/workflows/release-please.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,29 @@ jobs:
2323
token: ${{ secrets.GITHUB_TOKEN }}
2424
config-file: release-please-config.json
2525
manifest-file: .release-please-manifest.json
26-
release-play-internal-testing:
26+
release2play-internal-test-track:
2727
needs: release-please
2828
runs-on: ubuntu-latest
2929
if: ${{needs.release-please.outputs.app--release_created}}
3030
steps:
3131
- uses: actions/checkout@v4
32-
release-testflight:
33-
needs: release-please
34-
runs-on: macos-latest
35-
if: ${{needs.release-please.outputs.app--release_created}}
36-
steps:
37-
- uses: actions/checkout@v4
32+
- uses: ./.github/actions/setup-node-environment
33+
with:
34+
node-version: '20'
35+
cache-path: 'node_modules'
36+
cache-key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
37+
- run: npm i
38+
- uses: ./.github/actions/setup-expo
39+
with:
40+
expo-token: ${{ secrets.EXPO_TOKEN }}
41+
- name: Build aab
42+
run: npm run build:android
43+
- name: Upload to Play Store Internal Testing
44+
uses: r0adkll/upload-google-play@v1
45+
with:
46+
serviceAccountJsonPlainText: ${{ secrets.PLAY_CONSOLE_SERVICE_ACCOUNT_JSON }}
47+
packageName: package.name
48+
releaseFiles: app-release.aab
49+
track: internal
50+
status: draft
51+
inAppUpdatePriority: 2

eas.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"build": {
3+
"development": {
4+
"developmentClient": true,
5+
"distribution": "internal",
6+
"env": {
7+
8+
}
9+
},
10+
"preview": {
11+
"distribution": "internal",
12+
"env": {
13+
14+
}
15+
},
16+
"production": {
17+
"env": {
18+
}
19+
}
20+
},
21+
"cli": {
22+
"version": ">= 9.0.0",
23+
"appVersionSource": "local"
24+
}
25+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"web": "expo start --web",
1111
"lint": "eslint .",
1212
"android": "expo run:android",
13-
"test": "jest"
13+
"test": "jest",
14+
"build:android-dev": "eas build -p android --local --profile development --output app-dev.apk",
15+
"build:android-preview": "eas build -p android --local --profile preview --output app-preview.apk",
16+
"build:android": "NODE_ENV=production expo prebuild --clean && eas build -p android --local --profile production --output app-release.aab"
1417
},
1518
"dependencies": {
1619
"@expo/metro-runtime": "~3.2.3",

0 commit comments

Comments
 (0)