Build o2-full-deps repositories #98
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Create repositories with all O2 prerequisites plus aliBuild and push them | |
# upstream (e.g. to S3). | |
name: Build o2-full-deps repositories | |
# Controls when the action will run. This workflow is triggered manually. | |
"on": | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
rpm: | |
runs-on: ubuntu-latest | |
strategy: | |
# Keep running jobs for other CentOS/Alma/Fedora versions, even if one fails. | |
fail-fast: false | |
matrix: | |
# For every entry in el_version:, add an {el_version, container, alibuild_tag} entry to include:! | |
el_version: | |
- el7 | |
- el8 | |
- el9 | |
- fedora | |
# The include: key extends the matrix specified above with extra variables. | |
include: | |
- el_version: el7 | |
container: centos:7 | |
alibuild_tag: v1.17.12 | |
- el_version: el8 | |
container: almalinux:8 | |
alibuild_tag: v1.17.12 | |
- el_version: el9 | |
container: almalinux:9 | |
alibuild_tag: v1.17.12 | |
- el_version: fedora | |
container: fedora:40 | |
alibuild_tag: v1.17.12 | |
name: RPM (${{ matrix.el_version }}) | |
container: ${{ matrix.container }} | |
env: | |
ALIBUILD_TAG: ${{ matrix.alibuild_tag }} | |
DISTRO: ${{ matrix.el_version }} | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: 'true' # Only required for CentOS 7 | |
steps: | |
# For rpms/*.spec | |
- uses: actions/checkout@v3 | |
- name: Install prerequisites | |
run: | | |
set -ex | |
if [[ "$DISTRO" == "el7" ]]; then | |
sed -i.bak -e 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | |
sed -i.bak -r -e 's|# ?baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* | |
find /etc/yum.repos.d -name "*.bak" -delete | |
yum clean all | |
yum update -y | |
fi | |
yum clean all | |
yum update -y | |
yum install -y rpm-build scl-utils-build createrepo unzip git python3 python3-pip python3-setuptools | |
curl https://rclone.org/install.sh | bash | |
cat << EOF > /tmp/rclone.conf | |
${{ secrets.S3_RCLONE_CONFIG }} | |
EOF | |
- name: Build the ${{ matrix.el_version }} RPM and create a yum repo | |
run: | | |
set -ex | |
rpmbuild -ba "rpms/o2-prereq-$DISTRO.spec" | |
git clone -b "$ALIBUILD_TAG" https://github.com/alisw/alibuild | |
cd alibuild | |
case "$DISTRO" in | |
el7) deps=python3,git,python3-PyYAML,python3-requests,python3-distro ;; | |
*) deps=python3,git,python3-pyyaml,python3-requests,python3-distro ;; | |
esac | |
python3 setup.py bdist_rpm --requires "$deps" | |
cp dist/alibuild-*.noarch.rpm ~/rpmbuild/RPMS/"$(uname -m)"/ | |
cd ~/rpmbuild/RPMS/"$(uname -m)"/ | |
createrepo . | |
ls -la | |
case "$DISTRO" in | |
el7) repo_suffix=_ ;; | |
*) repo_suffix=_$DISTRO. ;; | |
esac | |
rclone --config /tmp/rclone.conf --transfers=10 --progress --delete-before \ | |
sync local:./ "rpms3:alibuild-repo/RPMS/o2-full-deps${repo_suffix}$(uname -m | tr _ -)/" | |
deb-ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
# Keep running jobs for other Ubuntu versions, even if one fails. | |
fail-fast: false | |
matrix: | |
ubuntu_codename: | |
- focal # 20.04 | |
- jammy # 22.04 | |
- mantic # 23.10 | |
- noble # 24.04 | |
name: DEB (${{ matrix.ubuntu_codename }}) | |
container: ubuntu:${{ matrix.ubuntu_codename }} | |
env: | |
ALIBUILD_TAG: v1.17.12 | |
ALIBUILD_DISTRO: ${{ matrix.ubuntu_codename }} | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- name: Install prerequisites | |
run: | | |
apt update | |
apt install -y vim git devscripts build-essential lintian debhelper dh-python python3-all python3-setuptools python3-setuptools-scm | |
mkdir -p ~/.gnupg | |
chmod 700 ~/.gnupg | |
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | |
echo -n "${{ secrets.LAUNCHPAD_PPA_GPG_KEY }}" | gpg --no-tty --batch --import | |
- name: Build a DEB for Ubuntu and push it to the PPA | |
run: | | |
set -x | |
git clone https://github.com/alisw/alibuild | |
cd alibuild | |
rm -rf .git | |
cat <<EOF > debian/changelog | |
python3-alibuild (${ALIBUILD_TAG#v}+$ALIBUILD_DISTRO) $ALIBUILD_DISTRO; urgency=medium | |
* Bump to $ALIBUILD_TAG | |
-- Giulio Eulisse <giulio.eulisse@cern.ch> $(date -R -u) | |
EOF | |
debuild --no-lintian -kA3A177D7C6BAD5C044ACAC10F56D273E83B84A47 -S -p'gpg --no-tty --passphrase ${{ secrets.LAUNCHPAD_PPA_GPG_PASS }}' | |
dput ppa:alisw/ppa "../python3-alibuild_${ALIBUILD_TAG#v}+${ALIBUILD_DISTRO}_source.changes" |