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
87 changes: 87 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Android Release Build

on:
workflow_dispatch:


jobs:
build:
name: Build Release APK
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build APK (release)
run: ./gradlew assembleRelease

- name: Upload Release APK
uses: actions/upload-artifact@v4
with:
name: release-apk
path: app/build/outputs/apk/release/app-release.apk

sonarcloud:
name: SonarCloud Scan
runs-on: ubuntu-latest
needs: build

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Run SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2
with:
projectBaseDir: .
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# trigger_gitlab:
# name: Trigger GitLab Pipeline
# runs-on: ubuntu-latest
# needs: sonarcloud
#
# steps:
# - name: Checkout repository (for GitLab sync)
# uses: actions/checkout@v3
#
# - name: Set up Git for GitLab sync
# run: |
# git config --global user.name "Denys Kramar"
# git config --global user.email "denys.kramar@onix-systems.com"
#
# - name: Push changes to GitLab
# run: |
# git remote set-url origin https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/onix-systems/android-sonar.git
# git push origin HEAD:WebHookTest
#
# - name: Trigger GitLab Pipeline
# run: |
# curl -X POST \
# -H "Authorization: token ${{ secrets.GITLAB_TOKEN }}" \
# -d '{"ref": "WebHookTest"}' \
# "https://gitlab.com/api/v4/projects/${{ secrets.GITLAB_PROJECT_ID }}/trigger/pipeline"
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class MainActivity : ComponentActivity() {
val packageInstaller: PackageInstaller = context.packageManager.packageInstaller
val params = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
params.setRequireUserAction(PackageInstaller.SessionParams.USER_ACTION_NOT_REQUIRED)
}

Expand Down