Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.67 KiB
Newer Older
image: briar/ci-image-android:bullseye
Nico's avatar
Nico committed
  - build
variables:
  GIT_SUBMODULE_STRATEGY: recursive
Nico's avatar
Nico committed
  JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
Nico's avatar
Nico committed
before_script:
  - set -e
  - export GRADLE_USER_HOME=$PWD/.gradle

after_script:
  # these file change every time and should not be cached
  - rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
  - rm -fr $GRADLE_USER_HOME/caches/*/plugin-resolution/

cache:
  key: "$CI_COMMIT_REF_SLUG"
  paths:
    - .gradle/wrapper
    - .gradle/caches

ktlint:
  stage: test
  script:
    - git submodule update
    - ./gradlew --no-daemon :check
Nico's avatar
Nico committed
    - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never # avoids duplicate jobs for branch and MR
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: always
    - when: always
Nico's avatar
Nico committed

build_jar:
  stage: build
  script:
Nico's avatar
Nico committed
    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 --no-daemon -x kaptKotlin packageUberJarForCurrentOS
Nico's avatar
Nico committed
    - mv build/compose/jars/Briar-*.jar ./briar-desktop.jar
  artifacts:
    paths:
      - briar-desktop.jar
    expire_in: 2 days
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"

build_deb:
  stage: build
  script:
Nico's avatar
Nico committed
    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-11-openjdk-amd64 --no-daemon kaptKotlin
    - ./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 --no-daemon -x kaptKotlin packageDeb
Nico's avatar
Nico committed
    - mv build/compose/binaries/main/deb/*.deb ./briar-desktop.deb
  artifacts:
    paths:
      - briar-desktop.deb
    expire_in: 2 days
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"