Files
performics_dev/.gitea/workflows/azure-pipelines.yml
T
NishantRajputRN 5de9d04dd3
RN APK Build / build (push) Has been cancelled
Sonar url change
2026-05-12 16:18:22 +05:30

80 lines
2.2 KiB
YAML

name: RN APK Build
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# ---------------- JAVA (Gradle + SonarScanner need JDK on Ubuntu) ----------------
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
# ---------------- NODE ----------------
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
# ---------------- SONARQUBE ----------------
# In Gitea: Repository → Settings → Secrets and variables → add secret SONAR_TOKEN
# (SonarQube user token). Name must be exactly SONAR_TOKEN — not the token value as the name.
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
# ---------------- ANDROID ----------------
# - name: Setup Android SDK
# uses: android-actions/setup-android@v3
# - name: Grant permission
# run: chmod +x android/gradlew
# ---------------- BUILD APK ----------------
- name: Build Release APK
run: |
cd android
./gradlew assembleRelease --stacktrace --info
# ---------------- VERIFY APK ----------------
- name: Check APK Output
run: |
ls -R android/app/build/outputs/apk
# ---------------- SAVE TO VM ----------------
- name: Save APK to VM folder
run: |
mkdir -p /home/azureuser/builds
cp android/app/build/outputs/apk/release/*.apk /home/azureuser/builds/
# ---------------- VERIFY FINAL ----------------
- name: Verify APK in VM
run: |
ls -l /home/azureuser/builds
# ---------------- (OPTIONAL) ARTIFACT ----------------
- name: Upload APK (optional)
uses: actions/upload-artifact@v3
with:
name: app-release
path: android/app/build/outputs/apk/release/*.apk