Skip to content
Draft
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
54 changes: 54 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

FROM mcr.microsoft.com/devcontainers/java:0-17

RUN <<-EOF
set -x
apt update
apt-get install -y ca-certificates curl gnupg expect git make wget unzip vim
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt update
apt install nodejs -y
npm install -g npm@10.2.5
EOF

RUN mkdir -p /usr/local/android-sdk-linux/cmdline-tools/latest
ENV ANDROID_HOME /usr/local/android-sdk-linux/cmdline-tools/latest
ENV PATH ${ANDROID_HOME}/tools:${ANDROID_HOME}/bin:$ANDROID_HOME/platform-tools:$PATH
ENV ANDROID_SDK_ROOT $ANDROID_SDK_HOME
ENV ANDROID_HOME $ANDROID_SDK_HOME
ENV ANDROID_SDK $ANDROID_SDK_HOME

# Set Debian to not prompt for user input during package installation
ENV DEBIAN_FRONTEND noninteractive

# Update package lists and install necessary packages
RUN apt update -yqq && \
apt install -y \
openssh-client \
locales \
libc6 libstdc++6 zlib1g libncurses5 build-essential libssl-dev ruby ruby-dev \
libarchive-tools && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# Set the locale to en_US.UTF-8
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

# Set the system language to US English
ENV LANG en_US.UTF-8

# Download and untar Android SDK tools
RUN <<-EOF
wget https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip -O tools.zip
bsdtar xvf tools.zip --strip-components=1 -C /usr/local/android-sdk-linux/cmdline-tools/latest
chown vscode:vscode -r /usr/local/android-sdk-linux/
rm tools.zip
EOF

RUN <<-EOF
sdkmanager --version
sdkmanager --sdk_root=/usr/local/android-sdk-linux/latest "platform-tools" "platforms;android-33"
EOF
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerFile": "Dockerfile",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"mavenVersion": "3.8.6",
"installGradle": "true",
"gradleVersion": "6.9.3"
}
},

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {},
"extensions": [
"streetsidesoftware.code-spell-checker",
"vscjava.vscode-gradle"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm ci"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
103 changes: 103 additions & 0 deletions .github/workflows/generate-apk-aab-debug-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Generated APK AAB (Upload - Create Artifact To Github Action)

env:
# The name of the main module repository
main_project_module: app

# The name of the Play Store
playstore_name: Overland

on:

push:
branches:
- 'release/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '8'
cache: 'gradle'

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Change wrapper permissions
working-directory: ./android
run: chmod +x ./gradlew

# Run Tests Build
- name: Run gradle tests
working-directory: ./android
run: ./gradlew test

# Run Build Project
- name: Build gradle project
working-directory: ./android
run: ./gradlew build

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
working-directory: ./android
run: ./gradlew assembleDebug

# Create APK Release
- name: Build apk release project (APK) - ${{ env.main_project_module }} module
working-directory: ./android
run: ./gradlew assemble

# Create Bundle AAB Release
# Noted for main module build [main_project_module]:bundleRelease
- name: Build app bundle release (AAB) - ${{ env.main_project_module }} module
working-directory: ./android
run: ./gradlew ${{ env.main_project_module }}:bundleRelease

# Upload Artifact Build
# Noted For Output [main_project_module]/build/outputs/apk/debug/
- name: Upload APK Debug - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) debug generated
path: ${{ env.main_project_module }}/build/outputs/apk/debug/

# Noted For Output [main_project_module]/build/outputs/apk/release/
- name: Upload APK Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) release generated
path: ${{ env.main_project_module }}/build/outputs/apk/release/

# Noted For Output [main_project_module]/build/outputs/bundle/release/
- name: Upload AAB (App Bundle) Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - App bundle(s) AAB release generated
path: ${{ env.main_project_module }}/build/outputs/bundle/release/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"test": "jest --passWithNoTests",
"lint": "eslint .",
"clean": "react-native-clean-project"
},
Expand Down