diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09d688e4..84326c37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,12 +103,16 @@ debugTests: connected 27 default x86_64: <<: *connected-template + +#inspired from https://gitlab.com/mvglasow/satstat/-/blob/master/.gitlab-ci.yml fdroid build: stage: build - image: registry.gitlab.com/fdroid/ci-images-client:latest + image: registry.gitlab.com/mvglasow/ci-images-server:latest tags: - server_artectrex + allow_failure: true artifacts: + # name: "${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}" paths: - signed/ when: always @@ -117,46 +121,15 @@ fdroid build: cache: key: "$CI_JOB_NAME" paths: - - .gradle - .android + - .gradle script: - # Put the correct versionName and versionCode in the .fdroid.yml + # Put the correct versionName and versionCode in the .fdroid.yml - sed -e "s/\${versionName}/$(grep "versionName " app/build.gradle | awk '{print $2}' | tr -d \")$(grep "versionCode" app/build.gradle -m 1 | awk '{print $2}')/" -e "s/\${versionCode}/$(grep "versionCode" app/build.gradle -m 1 | awk '{print $2}')/" .fdroid.yml.template > .fdroid.yml - rm .fdroid.yml.template - - test -d build || mkdir build - - test -d fdroidserver || mkdir fdroidserver - - git ls-remote https://gitlab.com/fdroid/fdroidserver.git master - - curl --silent https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver-master.tar.gz - | tar -xz --directory=fdroidserver --strip-components=1 - - export PATH="`pwd`/fdroidserver:$PATH" - - export PYTHONPATH="$CI_PROJECT_DIR/fdroidserver:$CI_PROJECT_DIR/fdroidserver/examples" - - export PYTHONUNBUFFERED=true - - - bash fdroidserver/buildserver/setup-env-vars $ANDROID_HOME - - adduser --disabled-password --gecos "" vagrant - - ln -s $CI_PROJECT_DIR/fdroidserver /home/vagrant/fdroidserver - - mkdir -p /vagrant/cache - - wget -q https://services.gradle.org/distributions/gradle-5.6.2-bin.zip --output-document=/vagrant/cache/gradle-5.6.2-bin.zip - # Check sha256 of the gradle build - - echo '32fce6628848f799b0ad3205ae8db67d0d828c10ffe62b748a7c0d9f4a5d9ee0 /vagrant/cache/gradle-5.6.2-bin.zip' | sha256sum -c - - bash fdroidserver/buildserver/provision-gradle - - bash fdroidserver/buildserver/provision-apt-get-install https://deb.debian.org/debian - - source /etc/profile.d/bsenv.sh - - apt-get dist-upgrade - - # install fdroidserver from git, with deps from Debian, until fdroidserver - # is stable enough to include all the things needed here - - apt-get install -t stretch-backports - fdroidserver - python3-asn1crypto - python3-ruamel.yaml - yamllint - - apt-get purge fdroidserver - - export GRADLE_USER_HOME=$PWD/.gradle - # each fdroid build --on-server run expects sudo, then uninstalls it + # each `fdroid build --on-server` run expects sudo, then uninstalls it - set -x - apt-get install sudo - - fdroid fetchsrclibs --verbose # this builds the latest version of the app from its source dir, using the build recipe in .fdroid.yml - fdroid build --verbose --on-server --no-tarball # create a keystore if we don’t have one