default: tags: - medium image: archlinux:latest stages: - build - post build: stage: build variables: GIT_SUBMODULE_STRATEGY: recursive 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 - 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 rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH changes: # - .gitlab-ci.yml # - pkgbuild.sh - repo/**/* - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_TITLE =~ /REBUILD/ script: - if [ -n "$TARGET_HOSTS" ]; then echo "$TARGET_HOSTS" | base64 -d >> /etc/hosts; fi; - bash -c './ci-upload.sh'