~mser/pkg.mser.at

ref: f3857863cc940544d9571dc7ecd6cfe112a8c5a6 pkg.mser.at/.build.yml -rw-r--r-- 1.5 KiB
f3857863Michael Serajnik Update package element-desktop-fork 4 months ago
                                                                                
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
packages:
  - lftp
  - python
  - wget
sources:
  - https://git.sr.ht/~mser/pkg.mser.at
environment:
  project: pkg.mser.at
  repository_name: pkg.mser.at
secrets:
  - 1490f587-44bb-4d54-bfc1-01d3225aab50
  - 5388bf43-0b6a-49ce-bbcc-a00b4e3363f7
  - c6d63afc-7656-45c3-abcf-0582492de374
tasks:
  - build_packages: |
      cd $project

      ./build-packages.py
  - add_packages_to_repository: |
      cd $project/repository

      if [ -z "$(ls -A)" ]; then
        echo "No packages added/modified."
        complete-build
      fi

      # If we force-rebuild everything, we discard the old database to get rid
      # of old packages
      if [ -z "$FORCE_REBUILD_PACKAGES" ]; then
        wget "https://$repository_name/$repository_name.db.tar.zst"
        wget "https://$repository_name/$repository_name.files.tar.zst"
      fi

      packages=$(find -name "*.pkg.tar.zst")

      repo-add "$repository_name.db.tar.zst" $packages
  - deploy_repository: |
      cd $project/repository

      set +x

      ftp_server=$(cat ~/.ftp-server)
      ftp_username=$(cat ~/.ftp-username)

      # If we force-rebuild everything, we delete all the files on the server
      # to get rid of old packages
      if [ -z "$FORCE_REBUILD_PACKAGES" ]; then
        lftp -c "open ftp://$ftp_username@$ftp_server ; set ftp:ssl-allow no ; mirror --reverse --dereference --parallel=10 . ."
      else
        lftp -c "open ftp://$ftp_username@$ftp_server ; set ftp:ssl-allow no ; mirror --reverse --delete --exclude=\.htaccess --dereference --parallel=10 . ."
      fi

      set -x