Skip to content

Add GitLab CI support to enable migration to GitLab #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
49 changes: 49 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
image: openjdk:8-jdk

variables:
ANDROID_COMPILE_SDK: "27"
ANDROID_BUILD_TOOLS: "28.0.3"
ANDROID_SDK_TOOLS: "4333796"

before_script:
- git submodule update --recursive --init
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 screenfetch
- screenfetch
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- echo "sdk.dir=$ANDROID_HOME" > local.properties
- echo "sdk-location=$ANDROID_HOME" >> local.properties
- chmod +x ./gradlew

stages:
- build
- sign

assembleRelease:
stage: build
script:
- 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
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
- ./gradlew build
artifacts:
untracked: true

signRelease:
stage: sign
dependencies:
- assembleRelease
script:
- mkdir outputs
- echo "${KEYSTORE}" | base64 -d - > microg.jks
- jarsigner -keystore microg.jks ./play-services-core/build/outputs/apk/release/play-services-core-release-unsigned.apk -storepass "${KEYSTORE_PASSWORD}" -keypass "${KEY_PASSWORD}" "${KEYSTORE_ALIAS}" --signedjar org.microg.gms.apk
- ${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}/zipalign -v 4 org.microg.gms.apk outputs/microg_gmscore.apk
artifacts:
paths:
- outputs