Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Additional notes:

#### Tasks
### Tasks

- [ ] Task 1
- [ ] Task 2
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/eas-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# This action is used to trigger an EAS Build for a specific environment (development, staging, production).
# This action is used to trigger an EAS Build for a specific environment (development, preview, production).
# This action accepts those inputs:
# `APP_ENV`, which is used to generate an APK for a specific environment (development, staging, production). We use staging by default.
# `APP_ENV`, which is used to generate an APK for a specific environment (development, preview, production). We use preview by default.
# `AUTO_SUBMIT`, false by default, set to true if you want to automatically submit your build to stores.
# `EXPO_TOKEN`, required, access token for your Expo account. https://expo.dev/settings/access-tokens
# `VERSION`, required, version of the app to build. used as the build message.
Expand All @@ -17,7 +17,7 @@
# - name: ⏱️ EAS Build
# uses: ./.github/actions/eas-build
# with:
# APP_ENV: staging
# APP_ENV: preview
# EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
# VERSION: ${{ github.event.release.tag_name }}
# IOS: false
Expand All @@ -28,7 +28,7 @@ inputs:
APP_ENV:
description: 'APP_ENV (one of): development, preview, production'
required: true
default: staging
default: preview

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing the staging to preview ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AUTO_SUBMIT: # # TODO: we need to handle this too
description: 'AUTO_SUBMIT (one of): true, false'
required: true
Expand Down Expand Up @@ -69,10 +69,10 @@ runs:

- name: 📱 Run Android Build
if: ${{ inputs.ANDROID == 'true' }}
run: pnpm build:${{ inputs.APP_ENV }}:android --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
run: bun run build:${{ inputs.APP_ENV }}:android --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
shell: bash

- name: 📱 Run IOS Build
if: ${{ inputs.IOS == 'true' }}
run: pnpm build:${{ inputs.APP_ENV }}:ios --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
run: bun run build:${{ inputs.APP_ENV }}:ios --non-interactive --no-wait --message "Build ${{ inputs.APP_ENV }} ${{ inputs.VERSION }}"
shell: bash
17 changes: 8 additions & 9 deletions .github/actions/setup-jdk-generate-apk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,43 @@
# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# This action is used to set up the JDK environment and generate an Android APK for testing.
# This action accepts one input: `APP_ENV`, which is used to generate an APK for a specific environment (development, staging, production). We use staging by default.
# This action accepts one input: `APP_ENV`, which is used to generate an APK for a specific environment (development, preview, production). We use preview by default.
# Before generating the APK, we run a pre-build script to generate the necessary native folders based on the APP_ENV.
# On success, the APK is generated at `./android/app/build/outputs/apk/release/app-release.apk`.

# 👀 Example usage:
# - name : 📦 Set Up JDK + Generate Test APK
# uses: ./.github/actions/setup-jdk-generate-apk
# with:
# APP_ENV: 'staging'
# APP_ENV: 'preview'

name: 'Setup JDK + GRADLE + Generate APK'
description: 'Setup JDK + GRADLE + Generate APK'
inputs:
APP_ENV:
description: 'APP_ENV (one of): development, staging, production'
description: 'APP_ENV (one of): development, preview, production'
required: true
default: staging
default: preview

runs:
using: composite
steps:
- name: Set Up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v4

- name: Generate Test APK
run: |
pnpm prebuild:${{ inputs.APP_ENV }}
bun run prebuild:${{ inputs.APP_ENV }}
cd android
chmod +x ./gradlew
./gradlew assembleRelease --no-daemon
cd ..
shell: bash
env:
EXPO_NO_DOTENV: '1'
APP_ENV: ${{ inputs.APP_ENV }}
# .env must load: app.config.ts validates env vars strictly during prebuild.
CI: 'true'
39 changes: 39 additions & 0 deletions .github/actions/setup-node-bun-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 🔗 Links:
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/actions/setup-node-bun-install/action.yml
# Composite actions docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action

# ✍️ Description:
# This is a composite action, which means it can be used in other actions.
# It is used in almost all workflows to set up the environment and install dependencies.
# Updating the package manager or Node version here will be reflected in all workflows.
# Bun is the package manager and script runner. Node is still required because Expo CLI and Metro run on it.
# The Node version comes from `.nvmrc` and the Bun version from the `packageManager` field in `package.json`.

# 👀 Example usage:
# - name : 📦 Setup Node + Bun + install deps
# uses: ./.github/actions/setup-node-bun-install

name: 'Setup Node + Bun + Install Dependencies'
description: 'Setup Node + Bun + Install Dependencies'
runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json

- name: 📦 Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: 📦 Install Project Dependencies
run: bun install --frozen-lockfile
shell: bash
29 changes: 0 additions & 29 deletions .github/actions/setup-node-pnpm-install/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Create Pull Request
if: steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v7
with:
title: Auto Compress Images
branch-suffix: timestamp
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/e2e-android-eas-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: wget ${{ github.event.inputs.apk-url }} -O ./app-release.apk

- name: Upload Test APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-apk
path: ./app-release.apk
Expand All @@ -52,16 +52,16 @@ jobs:
run: npm run install-maestro # # We use npm because we don't need to install deps again

- name: Download Test APK
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test-apk
path: ${{ github.workspace }}

- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v4

- name: AVD cache
uses: actions/cache@v3
uses: actions/cache@v4
id: avd-cache
with:
path: |
Expand Down Expand Up @@ -94,17 +94,17 @@ jobs:
profile: Nexus 6
script: |
adb install "${{ github.workspace }}/app-release.apk"
$HOME/.maestro/bin/maestro test .maestro/ --env=APP_ID=com.obytes.staging --format junit
$HOME/.maestro/bin/maestro test .maestro/ --env=APP_ID=com.obytes.preview --format junit

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: e2e-test-logs
path: ~/.maestro/tests/**/*

- name: Store tests result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: e2e_android_report
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e-android-maestro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ jobs:
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install
- name: 📦 Setup Node + Bun + install deps
uses: ./.github/actions/setup-node-bun-install

- name: 📦 Set Up JDK + Generate Test APK
uses: ./.github/actions/setup-jdk-generate-apk
with:
APP_ENV: staging
APP_ENV: preview

- name: Upload Test APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-apk
path: ./android/app/build/outputs/apk/release/app-release.apk
Expand All @@ -49,4 +49,4 @@ jobs:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: ./android/app/build/outputs/apk/release/app-release.apk
env: |
APP_ID=com.obytes.staging
APP_ID=com.obytes.preview
20 changes: 10 additions & 10 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ jobs:
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install
- name: 📦 Setup Node + Bun + install deps
uses: ./.github/actions/setup-node-bun-install

- name: 📦 Set Up JDK + Generate Test APK
uses: ./.github/actions/setup-jdk-generate-apk
with:
APP_ENV: staging
APP_ENV: preview

- name: Upload Test APK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-apk
path: ./android/app/build/outputs/apk/release/app-release.apk
Expand All @@ -60,16 +60,16 @@ jobs:
run: npm run install-maestro # # We use npm because we don't need to install deps again

- name: Download Test APK
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: test-apk
path: ${{ github.workspace }}

- name: Gradle cache
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v4

- name: AVD cache
uses: actions/cache@v3
uses: actions/cache@v4
id: avd-cache
with:
path: |
Expand Down Expand Up @@ -102,17 +102,17 @@ jobs:
profile: Nexus 6
script: |
adb install "${{ github.workspace }}/app-release.apk"
$HOME/.maestro/bin/maestro test .maestro/ --env=APP_ID=com.obytes.staging --format junit
$HOME/.maestro/bin/maestro test .maestro/ --env=APP_ID=com.obytes.preview --format junit

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: e2e-test-logs
path: ~/.maestro/tests/**/*

- name: Store tests result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: e2e_android_report
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/eas-build-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ✍️ Description:
# This workflow is used to trigger a build on EAS for the QA environment.
# It will run on every GitHub release published on the repo or can be triggered manually from the actions tab.
# This workflow will use ./actions/eas-build action to trigger the build on EAS with staging env.
# This workflow will use ./actions/eas-build action to trigger the build on EAS with preview env.

# 🚨 GITHUB SECRETS REQUIRED:
# - EXPO_TOKEN: Expo token to authenticate with EAS
Expand Down Expand Up @@ -34,8 +34,8 @@ jobs:
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install
- name: 📦 Setup Node + Bun + install deps
uses: ./.github/actions/setup-node-bun-install

- name: ⏱️ EAS Build
uses: ./.github/actions/eas-build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eas-build-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install
- name: 📦 Setup Node + Bun + install deps
uses: ./.github/actions/setup-node-bun-install

- name: ⏱️ EAS Build
uses: ./.github/actions/eas-build
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/expo-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ✍️ Description:
# This workflow runs the expo doctor command to check if your project dependencies are aligned with the expo sdk version you are using.
# Can be triggered manually from the Actions tab in your project.
# Runs Also on pull requests and pushes to the main/master branch, but only if the `package.json` or `pnpm-lock.yaml` files have been changed.
# Runs Also on pull requests and pushes to the main/master branch, but only if the `package.json` or `bun.lock` files have been changed.

# 🚨 GITHUB SECRETS REQUIRED: NONE

Expand All @@ -17,11 +17,11 @@ on:
- master
paths:
- package.json
- pnpm-lock.yaml
- bun.lock
pull_request:
paths:
- package.json
- pnpm-lock.yaml
- bun.lock

permissions:
contents: read
Expand All @@ -41,11 +41,11 @@ jobs:
with:
fetch-depth: 0

- name: 📦 Setup Node + PNPM + install deps
uses: ./.github/actions/setup-node-pnpm-install
- name: 📦 Setup Node + Bun + install deps
uses: ./.github/actions/setup-node-bun-install

- name: Run prebuild
run: pnpm run prebuild
run: bun run prebuild

- name: 🚑 Run Doctor Checks
run: |
Expand Down
Loading
Loading