sudo: required branches: only: - master cache: directories: - .ccache - .arch-cache - AUR-repo - LuxCore.git services: - docker arch: repos: - bartus=https://github.com/bartoszek/AUR-repo/raw/master packages: # disable to prevent `package-cleanup.hook` # - ccache # - moreutils script: - "echo 'options+=(ccache)' >> PKGBUILD" - "export CCACHE_DIR='/build/.ccache'" # COMPRESSXZ=(), can't be passed to makepkg as bash dosn't support array in `export` statement. - "echo 'COMPRESSXZ=(xz -T 0 -7 -c -z -)' >> PKGBUILD" # override `package-cleanup.hook` to preserve cache for travis. - "sudo mkdir /etc/pacman.d/hooks/ && sudo ln -s /dev/null /etc/pacman.d/hooks/package-cleanup.hook" - "sudo pacman -S --noconfirm ccache moreutils bc" # check for new version # @update_interval in days - "update_interval=5" - 'update_offset=$(. PKGBUILD; sha1sum <<<"$pkgname"|sed -e "s/[a-z -]//g" -e "s/^0*//"|echo `cat`%$update_interval|bc)' - "next_update=$(((365-`date +%j`+update_offset)%update_interval))" # force update on commit message containing [force|rebuild] - "force_update=$(git log --pretty=%B -1|egrep -q '\[(force|rebuild)\]'; echo $?" - "makepkg -od --skipinteg" - "new_pkgver=$(. PKGBUILD; [[ -v epoch ]] && echo -n $epoch:; echo $pkgver-$pkgrel)" - "old_pkgver=$(. PKGBUILD; pacman -S --print-format %v $pkgname|tail -n1)" - '[[ "$new_pkgver" == "$old_pkgver" && $next_update != 0 && $force_update != 0 ]] && { echo -e "Current version is up to date!\nNext force update in $next_update days!"; exit 0; }' # exit with makepkg return code - "set -o pipefail" - "makepkg -s --noconfirm TRAVIS=1 MAKEFLAGS='-j2' 2>&1 |ts -s '[%.T]'; makepkg_ret=$?" - "ccache -s" - "exit $makepkg_ret" script: - "curl -s https://raw.githubusercontent.com/bartoszek/arch-travis/pacman-pkg-cache/arch-travis.sh | bash" - "echo 'pacman pkg cache size: ' $(du -h .arch-cache|cut -f1) in $(ls .arch-cache|wc -l) files" deploy: on: branch: master skip_cleanup: true provider: script script: bash .travis_deploy.sh