summarylogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: afc0e93f39d2abaa1f7b276e5f4a9fc737268e9e (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
build:
  stage: build
  image:
    name: countstarlight/makepkg:latest
    entrypoint: [""]
  before_script:
    - yay -Syu --noconfirm
  script:
    - |
      depends=()
      makedepends=()
      checkdepends=()
      . ./PKGBUILD
      deps=( "${depends[@]}" "${makedepends[@]}" "${checkdepends[@]}" )
      (pacman --deptest "${deps[@]}" || true) | xargs yay -Sy --noconfirm
    - makepkg -f
  artifacts:
    untracked: false
    expire_in: 5 days
    paths:
      - '*.pkg.tar.zst'

test:
  stage: test
  image:
    name: countstarlight/makepkg:latest
    entrypoint: [""]
  script:
    - yay -Sy --noconfirm
    - yay -S --noconfirm archlinux-keyring
    - yay -S --noconfirm python-portalocker
    - yay --noconfirm -U *.pkg.tar.zst
    - autosuspend -h

deploy:
  stage: deploy
  image: bitnami/git:latest
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  variables:
    GIT_DEPTH: "0"
  before_script:
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh

    - ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts

    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -

  script:
    - git remote add aur ssh://aur@aur.archlinux.org/autosuspend.git
    - git push aur origin/master:master