forked from msys2/MSYS2-packages-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci-build.sh
executable file
·44 lines (38 loc) · 1.72 KB
/
ci-build.sh
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
#!/bin/bash
set -e
# AppVeyor and Drone Continuous Integration for MSYS2
# Author: Renato Silva <[email protected]>
# Author: Qian Hong <[email protected]>
# Configure
cd "$(dirname "$0")"
source 'ci-library.sh'
mkdir artifacts
git_config user.email '[email protected]'
git_config user.name 'MSYS2 Continuous Integration'
git remote add upstream 'https://github.com/MSYS2/MSYS2-packages-dev'
git fetch --quiet upstream
# So that makepkg auto-fetches keys from validpgpkeys
mkdir -p ~/.gnupg && echo -e "keyserver keyserver.ubuntu.com\nkeyserver-options auto-key-retrieve" > ~/.gnupg/gpg.conf
# reduce time required to install packages by disabling pacman's disk space checking
sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf
# Detect
list_commits || failure 'Could not detect added commits'
list_packages || failure 'Could not detect changed files'
message 'Processing changes' "${commits[@]}"
test -z "${packages}" && success 'No changes in package recipes'
define_build_order || failure 'Could not determine build order'
# Build
message 'Building packages' "${packages[@]}"
execute 'Approving recipe quality' check_recipe_quality
for package in "${packages[@]}"; do
execute 'Building binary' makepkg --noconfirm --noprogressbar --nocheck --syncdeps --rmdeps --cleanbuild
execute 'Building source' makepkg --noconfirm --noprogressbar --allsource
grep -qFx "${package}" ci-dont-install-list.txt || execute 'Installing' yes:pacman --noprogressbar --upgrade *.pkg.tar.*
execute 'Checking dll depencencies' list_dll_deps ./pkg
mv "${package}"/*.pkg.tar.* artifacts
mv "${package}"/*.src.tar.gz artifacts
unset package
done
success 'All packages built successfully'
cd artifacts
execute 'SHA-256 checksums' sha256sum *