blob: e152bcc31b500224d6e03202bb5000c8407f056f (
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
55
56
57
|
default:
image:
archlinux:latest
stages:
- build
- post
build:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
artifacts:
paths:
- packages/
- .fail
expire_in: 4 hours
only:
changes:
- .gitlab-ci.yml
- utils/pkgbuild.sh
- repo/**/*
- makepkg.d/*
script:
#- echo -e '\n[archlinuxcn]\nServer = https://repo.archlinuxcn.org/$arch\n' >> /etc/pacman.conf
- bash -c "echo -e '\n[kunoisayami]\nServer = https://$REPO_REMOTE/\$arch\n' >> /etc/pacman.conf"
- pacman-key --init
# import myself key first
- curl -fL https://keys.openpgp.org/vks/v1/by-fingerprint/4A0F0C8BC709ACA4341767FB243975C8DB9656B9 | pacman-key --add -
- pacman-key --finger 4A0F0C8BC709ACA4341767FB243975C8DB9656B9
- pacman-key --lsign-key 4A0F0C8BC709ACA4341767FB243975C8DB9656B9
- pacman --noconfirm --needed -Syu 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 './utils/pkgbuild.sh --import-gpg' build
- su -c './utils/pkgbuild.sh' build
- "rm -rf build/ || true"
# only push to master master trigger push
post:
stage: post
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
- 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 './utils/ci-upload.sh'
|