From f16a719edab1d3d516accb42d6eee15743d78269 Mon Sep 17 00:00:00 2001 From: Metin Kale Date: Mon, 25 Dec 2023 17:04:31 +0100 Subject: [PATCH] Add build pipeline (#205) --- .github/workflows/androidci.yml | 25 ++++++++++++++++++ .gitlab-ci.yml | 46 --------------------------------- ci_build.sh | 3 +++ gradle.properties | 2 +- 4 files changed, 29 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/androidci.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/androidci.yml b/.github/workflows/androidci.yml new file mode 100644 index 00000000..d3c7820c --- /dev/null +++ b/.github/workflows/androidci.yml @@ -0,0 +1,25 @@ +name: Build with FDroid Flavor + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for ci_build.sh + run: chmod +x ci_build.sh + - name: Build with ci_build.sh + run: ./ci_build.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4a18b11f..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -image: openjdk:8-jdk - -variables: - ANDROID_COMPILE_SDK: "28" - ANDROID_BUILD_TOOLS: "28.0.3" - ANDROID_SDK_TOOLS: "4333796" - -before_script: - - apt-get --quiet update --yes - - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 - - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip - - unzip -d android-sdk-linux android-sdk.zip - - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null - - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null - - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null - - export ANDROID_HOME=$PWD/android-sdk-linux - - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/ - # temporarily disable checking for EPIPE error and use yes to accept all licenses - - set +o pipefail - - yes | android-sdk-linux/tools/bin/sdkmanager --licenses - - set -o pipefail - - chmod +x ./fdroidPrep.sh - - chmod +x ./gradlew - - echo "FabricApiKey=$FABRIC_APIKEY" >> ./gradle.properties - - echo "GoogleApiKey=$MAPS_KEY" >> ./gradle.properties - - echo "android.enableJetifier=true" >> ./gradle.properties - - echo "android.useAndroidX=true" >> ./gradle.properties -stages: - - build - -buildPlay: - stage: build - script: - - ./gradlew assemblePlayDebug - artifacts: - paths: - - app/build/outputs/apk/play/debug/app-play-debug.apk - -buildFdroid: - stage: build - script: - - ./fdroidPrep.sh - - ./gradlew assembleFdroidDebug - artifacts: - paths: - - app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk \ No newline at end of file diff --git a/ci_build.sh b/ci_build.sh index 675de254..9f90e160 100644 --- a/ci_build.sh +++ b/ci_build.sh @@ -12,6 +12,7 @@ else cd open-prayer-times chmod +x gradlew fi +echo "org.gradle.daemon=false" >> gradle.properties ./gradlew publishToMavenLocal --no-daemon cd .. @@ -35,5 +36,7 @@ sed -e '/crashlytics/ s/^\/*/\/\//' -i build.gradle # build project echo "Build project" +echo "org.gradle.daemon=false" >> gradle.properties +echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m" >> gradle.properties chmod +x gradlew ./gradlew assembleFdroid --no-daemon diff --git a/gradle.properties b/gradle.properties index 5d62dd3d..77fbcb18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,4 @@ android.useAndroidX=true android.enableJetifier=true android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false \ No newline at end of file +android.nonTransitiveRClass=false