Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
genofire
donkey
Commits
77fc5a5c
Verified
Commit
77fc5a5c
authored
Aug 11, 2019
by
genofire
Committed by
genofire
Aug 12, 2019
Browse files
easy gitlab-ci with fdroid nightly support
parent
c7f1b572
Pipeline
#1830
passed with stage
in 1 minute and 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
77fc5a5c
image
:
registry.gitlab.com/fdroid/ci-images-client:latest
cache
:
paths
:
-
.gradle/wrapper
-
.gradle/caches
stages
:
-
build
before_script
:
-
export GRADLE_USER_HOME=$PWD/.gradle
-
export ANDROID_COMPILE_SDK=`sed -n 's,.*compileSdkVersion\s*\([0-9][0-9]*\).*,\1,p' app/build.gradle`
-
echo y | sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
build
:
stage
:
build
except
:
-
develop
script
:
-
./gradlew tasks
artifacts
:
paths
:
-
build/outputs/
publish
:
stage
:
build
only
:
-
develop
script
:
# workaround for deploy release in fdroid nightly
-
sed -i "s/-debug.apk/-unsigned.apk/" /usr/lib/python3/dist-packages/fdroidserver/nightly.py
# generate new version
-
export versionCode="$CI_JOB_ID"
-
export versionName="$(git describe --tag --abbrev=0)-${CI_JOB_ID}_${CI_COMMIT_REF_NAME}"
-
echo "set VersionCode '${versionCode}' and VersonName '${versionName}'"
-
sed -i "s/^\(\s*versionCode\s*\).*$/\1$versionCode/" build.gradle
-
sed -i "0,/versionName/s/^\(\s*versionName\).*/\1 \"$versionName\"/" build.gradle
-
cat -n build.gradle
# build free version
-
./gradlew assembleRelease
# publish on nightly fdroid repo
-
fdroid nightly -v
after_script
:
# this file changes every time but should not be cached
-
rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
-
rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment