summaryrefslogtreecommitdiffstats
path: root/.builds/archlinux.yml
blob: 3909b104e66fe8870c3565f1dc44937800b5c55b (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
image: archlinux
repositories:
  sr.ht: https://mirror.sr.ht/archlinux/sr.ht/#1ED4E14494433AE3FD302CAB74B4BCCEA60D0437
packages:
  - sassc
  - python-setuptools
  - python-srht
  - python-pygit2
  - python-celery
  - python-redis
  - python-flask-login
  - rsync
  - pacman-contrib
sources:
  - https://git.sr.ht/~sircmpwn/man.sr.ht
  - https://git.sr.ht/~sircmpwn/sr.ht-pkgbuilds
environment:
  repo_server: deploy@mirror.sr.ht
  repo_path: /var/www/mirror.sr.ht/archlinux/sr.ht/
secrets:
  - fa00a8d3-7b63-42d5-8060-3bb31c3e3018 # ssh deploy key
  - 3e65a1a8-a20f-4f6b-a452-df2ac398bc1e # package signing key
tasks:
  - build: |
      cd man.sr.ht
      ./setup.py build
  - archive: |
      cd man.sr.ht
      pkgver=$(git describe | sed -e 's/-/_/g')
      echo "pkgver=$pkgver" >> ~/.buildenv
      git archive -o ~/sr.ht-pkgbuilds/man.sr.ht/man.sr.ht-$pkgver.tar.xz \
        --prefix=man.sr.ht-$pkgver/ HEAD
  - package: |
      cd sr.ht-pkgbuilds/man.sr.ht
      pkgrel=$(pacman -Si man.sr.ht | grep Version | cut -d'-' -f2)
      pkgrel=$(expr $pkgrel + 1)
      sed -e "s/pkgver=.*/pkgver=$pkgver/" -i PKGBUILD
      sed -e "s/pkgrel=.*/pkgrel=$pkgrel/" -i PKGBUILD
      echo "pkgrel=$pkgrel" >> ~/.buildenv
      updpkgsums
      makepkg --config ../makepkg.conf -s --noconfirm
      cd ~/man.sr.ht
      git describe --exact-match HEAD || complete-build
  - deploy: |
      cd sr.ht-pkgbuilds/man.sr.ht
      sshopts="-o StrictHostKeyChecking=no" # TODO: remove this when builds run on a tty
      rsync --blocking-io \
        --rsh="ssh $sshopts" -rP *.pkg.tar.xz{,.sig} $repo_server:$repo_path/
      ssh $sshopts $repo_server repo-add -n -R \
        $repo_path/sr.ht.db.tar.gz \
        $repo_path/man.sr.ht-$pkgver-$pkgrel-any.pkg.tar.xz
      ssh $sshopts $repo_server repo-add -n -R \
        $repo_path/sr.ht.db.tar.gz \
        $repo_path/man.sr.ht-images-$pkgver-$pkgrel-any.pkg.tar.xz