summarylogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 3d859413055a428112ef9ecd1b53947608725291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
build:
  image: archlinux/base
  stage: deploy
  retry: 1
  cache:
    paths:
      - cargo/
  artifacts:
    paths:
      - '*.pkg.tar.xz'
  before_script:
    - pacman -Sy --noconfirm --needed --noprogressbar archlinux-keyring
    - pacman -Sy --noconfirm --needed --noprogressbar sudo curl pacman ca-certificates
    - pacman -Sy --noconfirm --needed --noprogressbar base-devel namcap
    - pacman -Syu --noconfirm --needed --noprogressbar
    - pacman-db-upgrade
    - update-ca-trust
    - useradd -m -G wheel build
    - chown -R build .
    - chgrp -R build .
    - 'echo -e "Cmnd_Alias\tBUILDERS = /usr/sbin/pacman, /usr/sbin/makepkg, /usr/bin/pacman, /usr/bin/makepkg, /usr/bin/multilib-build, /usr/bin/extra-x86_64-build, /usr/bin/arch-nspawn\nbuild\tALL = NOPASSWD: BUILDERS" >> /etc/sudoers.d/build'
    - chmod 0440 /etc/sudoers.d/build
    - chown root:root /etc/sudoers.d/build

  script:
    - 'du -sh cargo src/electrs/target || :'
    - sudo -u build makepkg --log --syncdeps --force --noconfirm --noprogressbar CARGO_HOME="$CI_PROJECT_DIR/cargo"
    - 'find . -iname "*.pkg.tar.xz" -exec namcap --machine-readable {} \;'