default: tags: - medium image: archlinux:latest stages: - build - post build: stage: build artifacts: untracked: true expire_in: 1 day only: changes: - .gitlab-ci.yml - pkgbuild.sh - repo/**/* script: - echo -e '\n[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch\n' >> /etc/pacman.conf - pacman-key --init - pacman --noconfirm --needed -Sy archlinuxcn-keyring - pacman --noconfirm --needed -Su base-devel gnupg git yay - git submodule update --init - useradd -m build - echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers #- cp -r ../$CI_PROJECT_TITLE /home/build/ #- cd /home/build/$CI_PROJECT_TITLE - chown -R build:build ../$CI_PROJECT_TITLE - su -c 'echo $GPG_PRIV_KEY | base64 -d | gpg --import' build - su -c './pkgbuild.sh' build - rm -rf build/ # only push to master master trigger push post: stage: post only: refs: - master changes: - repo/**/* script: - if [ -n "$TARGET_HOSTS" ]; then echo "$TARGET_HOSTS" | base64 -d >> /etc/hosts; fi; - bash -c './ci-upload.sh'