Merge pull request #2190 from lazka/ci-scripts-sync

CI: Sync CI scripts with the mingw repo
This commit is contained in:
Christoph Reiter
2020-10-16 11:16:08 +02:00
committed by GitHub
3 changed files with 10 additions and 63 deletions

View File

@@ -16,6 +16,8 @@ git remote add upstream 'https://github.com/MSYS2/MSYS2-packages'
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'
@@ -26,7 +28,6 @@ define_build_order || failure 'Could not determine build order'
# Build
message 'Building packages' "${packages[@]}"
execute 'Updating system' update_system
execute 'Approving recipe quality' check_recipe_quality
for package in "${packages[@]}"; do
execute 'Building binary' makepkg --noconfirm --noprogressbar --nocheck --syncdeps --rmdeps --cleanbuild
@@ -37,10 +38,7 @@ for package in "${packages[@]}"; do
mv "${package}"/*.src.tar.gz artifacts
unset package
done
success 'All packages built successfully'
# Deploy
deploy_enabled && cd artifacts || success 'All packages built successfully'
execute 'Generating pacman repository' create_pacman_repository "${PACMAN_REPOSITORY_NAME:-ci-build}"
execute 'Generating build references' create_build_references "${PACMAN_REPOSITORY_NAME:-ci-build}"
cd artifacts
execute 'SHA-256 checksums' sha256sum *
success 'All artifacts built successfully'

View File

@@ -5,12 +5,10 @@
# Author: Qian Hong <fracting@gmail.com>
# Enable colors
if [[ -t 1 ]]; then
normal='\e[0m'
red='\e[1;31m'
green='\e[1;32m'
cyan='\e[1;36m'
fi
normal=$(tput sgr0)
red=$(tput setaf 1)
green=$(tput setaf 2)
cyan=$(tput setaf 6)
# Basic status function
_status() {
@@ -93,19 +91,6 @@ _build_add() {
sorted_packages+=("${package}")
}
# Download previous artifact
_download_previous() {
local filenames=("${@}")
[[ "${DEPLOY_PROVIDER}" = bintray ]] || return 1
for filename in "${filenames[@]}"; do
if ! wget --no-verbose "https://dl.bintray.com/${BINTRAY_ACCOUNT}/${BINTRAY_REPOSITORY}/${filename}"; then
rm -f "${filenames[@]}"
return 1
fi
done
return 0
}
# Git configuration
git_config() {
local name="${1}"
@@ -129,14 +114,6 @@ execute(){
cd - > /dev/null
}
# Update system
update_system() {
repman add ci.msys 'https://dl.bintray.com/alexpux/msys2' || return 1
pacman --noconfirm --noprogressbar --sync --refresh --refresh --sysupgrade --sysupgrade || return 1
test -n "${DISABLE_QUALITY_CHECK}" && return 0 # TODO: remove this option when not anymore needed
pacman --noconfirm --needed --noprogressbar --sync ci.msys/pactoys
}
# Sort packages by dependency
define_build_order() {
local sorted_packages=()
@@ -146,34 +123,6 @@ define_build_order() {
packages=("${sorted_packages[@]}")
}
# Associate artifacts with this build
create_build_references() {
local repository_name="${1}"
local references="${repository_name}.builds"
_download_previous "${references}" || touch "${references}"
for file in *; do
sed -i "/^${file}.*/d" "${references}"
printf '%-80s%s\n' "${file}" "${BUILD_URL}" >> "${references}"
done
sort "${references}" | tee "${references}.sorted" | sed -r 's/(\S+)\s.*\/([^/]+)/\2\t\1/'
mv "${references}.sorted" "${references}"
}
# Add packages to repository
create_pacman_repository() {
local name="${1}"
_download_previous "${name}".{db,files}{,.tar.xz}
repo-add "${name}.db.tar.xz" *.pkg.tar.*
}
# Deployment is enabled
deploy_enabled() {
test -n "${BUILD_URL}" || return 1
[[ "${DEPLOY_PROVIDER}" = bintray ]] || return 1
local repository_account="$(git remote get-url origin | cut -d/ -f4)"
[[ "${repository_account,,}" = "${BINTRAY_ACCOUNT,,}" ]]
}
# Added commits
list_commits() {
_list_changes commits '*' '#*::' --pretty=format:'%ai::[%h] %s'

View File

@@ -1,7 +1,7 @@
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
pkgname=meson
pkgver=0.55.1
pkgver=0.55.3
pkgrel=1
pkgdesc='High-productivity build system'
arch=('any')
@@ -10,7 +10,7 @@ license=('Apache 2')
depends=('python' 'python-setuptools' 'ninja')
source=("https://github.com/mesonbuild/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz"
"cygwin-disguise.patch")
sha256sums=('3b5741f884e04928bdfa1947467ff06afa6c98e623c25cef75adf71ca39ce080'
sha256sums=('6bed2a25a128bbabe97cf40f63165ebe800e4fcb46db8ab7ef5c2b5789f092a5'
'94eccd752284a08811c41b2afd1801ccc0274affac7ada5356b413a8f0f43164')
prepare() {