2021-04-22 12:44:09 +03:00
|
|
|
name: "QA"
|
|
|
|
|
|
|
|
on:
|
2022-12-16 17:13:55 +03:00
|
|
|
pull_request:
|
|
|
|
branches: [ master, stable-* ]
|
2021-04-22 12:44:09 +03:00
|
|
|
|
2022-12-16 14:24:03 +03:00
|
|
|
permissions:
|
2022-12-16 17:13:55 +03:00
|
|
|
pull-requests: write
|
|
|
|
contents: read
|
2022-12-16 14:24:03 +03:00
|
|
|
|
2021-04-22 12:44:09 +03:00
|
|
|
jobs:
|
2022-12-16 17:13:55 +03:00
|
|
|
qa:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check if secrets are available
|
|
|
|
run: echo "::set-output name=ok::${{ secrets.KS_PASS != '' }}"
|
|
|
|
id: check-secrets
|
2023-03-21 02:58:02 +03:00
|
|
|
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
2022-12-16 17:13:55 +03:00
|
|
|
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
|
|
|
- name: set up JDK 11
|
2023-02-14 11:27:48 +03:00
|
|
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98 # v3
|
2022-12-16 17:13:55 +03:00
|
|
|
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
|
|
|
with:
|
|
|
|
distribution: "temurin"
|
|
|
|
java-version: 11
|
|
|
|
- name: Build QA
|
|
|
|
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
|
|
|
|
env:
|
|
|
|
KS_PASS: ${{ secrets.KS_PASS }}
|
|
|
|
KEY_PASS: ${{ secrets.KEY_PASS }}
|
|
|
|
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
|
|
|
|
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/.gradle
|
|
|
|
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
|
|
|
|
sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" app/build.gradle
|
|
|
|
sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" app/build.gradle
|
|
|
|
./gradlew assembleQaDebug
|
|
|
|
$(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks app/build/outputs/apk/qa/debug/app-qa-*.apk
|
|
|
|
sudo scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD ${{github.event.number}} ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }}
|