Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

fix: remove usage of hardcoded 'debug' variant in AndroidModule class #1535

fix: remove usage of hardcoded 'debug' variant in AndroidModule class

fix: remove usage of hardcoded 'debug' variant in AndroidModule class #1535

Workflow file for this run

name: Build and test
on:
push:
branches: [ "dev", "main", "rework-tooling-api" ]
paths-ignore:
- '**.md'
- 'fastlane/**'
- '.github/workflows/crowdin_contributors.yml'
pull_request:
branches: [ "dev" ]
paths-ignore:
- '**.md'
- 'fastlane/**'
- '.github/workflows/crowdin_contributors.yml'
workflow_dispatch: { }
jobs:
build_apk:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble Debug
if: ${{ github.ref != 'refs/heads/main' }}
run: ./gradlew assembleDebug
env:
ReleaseAndroidIDE: false
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
IDE_SIGNING_AUTH_USER: ${{ secrets.IDE_SIGNING_AUTH_USER }}
IDE_SIGNING_KEY_PASS: ${{ secrets.IDE_SIGNING_KEY_PASS }}
IDE_SIGNING_STORE_PASS: ${{ secrets.IDE_SIGNING_STORE_PASS }}
IDE_SIGNING_URL: ${{ secrets.IDE_SIGNING_URL }}
IDE_SIGNING_KEY_BIN: ${{ secrets.IDE_SIGNING_KEY_BIN }}
- name: Copy debug APK
if: ${{ github.ref != 'refs/heads/main' }}
run: cp app/build/outputs/apk/**/debug/*.apk ./
- name: Assemble Release
if: ${{ github.ref == 'refs/heads/main' }}
run: ./gradlew assembleRelease
env:
ReleaseAndroidIDE: true
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
IDE_SIGNING_AUTH_USER: ${{ secrets.IDE_SIGNING_AUTH_USER }}
IDE_SIGNING_KEY_PASS: ${{ secrets.IDE_SIGNING_KEY_PASS }}
IDE_SIGNING_STORE_PASS: ${{ secrets.IDE_SIGNING_STORE_PASS }}
IDE_SIGNING_URL: ${{ secrets.IDE_SIGNING_URL }}
IDE_SIGNING_KEY_BIN: ${{ secrets.IDE_SIGNING_KEY_BIN }}
- name: Copy release APK
if: ${{ github.ref == 'refs/heads/main' }}
run: cp app/build/outputs/apk/**/release/*.apk ./
- name: Upload arm64-v8a-debug APK
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: apk-arm64-v8a-debug
path: app-arm64-v8a-arm64-v8a-debug.apk
- name: Upload armeabi-v7a-debug APK
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: apk-armeabi-v7a-debug
path: app-armeabi-v7a-armeabi-v7a-debug.apk
- name: Upload arm64-v8a-release APK
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: apk-arm64-v8a-release
path: app-arm64-v8a-arm64-v8a-release.apk
- name: Upload armeabi-v7a-release APK
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: apk-armeabi-v7a-release
path: app-armeabi-v7a-armeabi-v7a-release.apk
unit_test_debug:
name: Run local tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run debug tests
run: ./gradlew runTestsInCI --continue
env:
ANDROIDIDE_TEST: true
IDE_SIGNING_ALIAS: ${{ secrets.IDE_SIGNING_ALIAS }}
IDE_SIGNING_AUTH_PASS: ${{ secrets.IDE_SIGNING_AUTH_PASS }}
IDE_SIGNING_AUTH_USER: ${{ secrets.IDE_SIGNING_AUTH_USER }}
IDE_SIGNING_KEY_PASS: ${{ secrets.IDE_SIGNING_KEY_PASS }}
IDE_SIGNING_STORE_PASS: ${{ secrets.IDE_SIGNING_STORE_PASS }}
IDE_SIGNING_URL: ${{ secrets.IDE_SIGNING_URL }}
IDE_SIGNING_KEY_BIN: ${{ secrets.IDE_SIGNING_KEY_BIN }}
- name: Upload Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test-reports
path: '**/build/reports/tests/'
publish:
name: Publish release
runs-on: ubuntu-latest
needs: [ build_apk, unit_test_debug ]
if: ${{ always() && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && needs.build_apk.result == 'success' && needs.unit_test_debug.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Download arm64-v8a APK
uses: actions/download-artifact@v3
with:
name: apk-arm64-v8a-release
- name: Download armeabi-v7a APK
uses: actions/download-artifact@v3
with:
name: apk-armeabi-v7a-release
- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Publish release
run: ./gradlew nyxMake nyxMark nyxPublish publish release --stacktrace
env:
ReleaseAndroidIDE: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MVN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MVN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MVN_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MVN_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MVN_SIGNING_KEY_PASSWORD }}
- name: Archive Nyx state file
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: .nyx-state-${{ github.job }}.json
path: build/nyx-state.json
publish_snapshots:
name: Publish package snapshots
runs-on: ubuntu-latest
needs: [ build_apk ]
if: ${{ always() && github.ref != 'refs/heads/main' && github.event_name != 'pull_request' && needs.build_apk.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Publish snapshots
run: ./gradlew publishAllPublicationsToMavenCentralRepository --stacktrace
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MVN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MVN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MVN_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MVN_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MVN_SIGNING_KEY_PASSWORD }}