# Java Gradle CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-java/ for more details # version: 2 jobs: test: docker: # specify the version you desire here - image: cimg/openjdk:19.0.1 # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ # - image: circleci/postgres:9.4 working_directory: ~/repo environment: # Customize the JVM maximum heap limit JVM_OPTS: -Xmx3200m TERM: dumb steps: - checkout # install dependencies - run: sudo apt-get update - run: sudo apt-get install -y libx11-dev libxpm-dev libxrandr-dev libpango1.0-dev libicu-dev libxml2-dev libtinfo6 # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- # run tests! https://youtrack.jetbrains.com/issue/KT-32608 - run: gradle nativeTest - save_cache: paths: - ~/.gradle - ~/.konan key: v1-dependencies-{{ checksum "build.gradle.kts" }} - store_test_results: path: build/test-results deploy_aur: docker: - image: atennert/archlinux-cci-aur:0.0.4 auth: username: atennert password: $DOCKERHUB_PASSWORD steps: - add_ssh_keys: fingerprints: - 78:cd:db:a2:c1:cb:65:7a:16:75:b9:ec:08:7b:62:c3 # get deployment files for lcarswm - run: git clone ssh://aur@aur.archlinux.org/lcarswm.git - run: cd lcarswm && git config user.email "$AUR_GIT_EMAIL" - run: cd lcarswm && git config user.name "$AUR_GIT_NAME" # log the current contents - run: cat lcarswm/PKGBUILD - run: cat lcarswm/.SRCINFO # update content - run: cd lcarswm && sed -i -e "s/^pkgver=[0-9\.]*$/pkgver=$CIRCLE_TAG/" PKGBUILD - run: cd lcarswm && sed -i -e "s/^pkgrel=[0-9]*$/pkgrel=1/" PKGBUILD - run: cd lcarswm && updpkgsums - run: cd lcarswm && makepkg --printsrcinfo > .SRCINFO # log the new contents - run: cat lcarswm/PKGBUILD - run: cat lcarswm/.SRCINFO # upload new contents - run: cd lcarswm && git add -u && git commit -m "update to version $CIRCLE_TAG" && git push deploy_ubuntu: docker: - image: cimg/base:current-22.04 working_directory: ~/repo steps: - checkout # install dependencies - run: sudo apt-get update - run: sudo apt-get install -y default-jdk-headless devscripts debhelper fakeroot libx11-dev libxpm-dev libxrandr-dev libpango1.0-dev libicu-dev libxml2-dev libtinfo6 # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: ./deploy-deb.sh lcarswm - run: | if ls -1qA ~/repo/build/deb/deploy | grep -q . ; then echo "deb package built!"; else echo "deb package not built"; exit 1 fi - persist_to_workspace: root: ~/repo paths: - build/deb/deploy publish_github_release: docker: - image: cibuilds/github:0.10 steps: - attach_workspace: at: ~/repo - run: ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ~/repo/build/deb/deploy/ workflows: version: 2 build_and_deploy: jobs: - test: filters: tags: only: /.*/ - deploy_aur: context: - lcarsde-context requires: - test filters: tags: only: /.*/ branches: ignore: /.*/ - deploy_ubuntu: context: - lcarsde-context requires: - test filters: tags: only: /.*/ branches: ignore: /.*/ - publish_github_release: context: - lcarsde-context requires: - deploy_ubuntu filters: tags: only: /.*/ branches: ignore: /.*/