Update Lib Packages #41
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
name: Update Lib Packages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '4 4 * * 0,3' | |
env: | |
GIT_AUTHOR_NAME: Foreman Packaging Automation | |
GIT_AUTHOR_EMAIL: [email protected] | |
PULPCORE_REQUIREMENTS: automation/requirements.txt | |
PULPCORE_FULL_REQUIREMENTS: pulpcore-requirements.txt | |
PULPCORE_PACKAGES_TO_UPDATE: packages-to-update.txt | |
jobs: | |
generate_package_list: | |
name: 'Gather Packages' | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
container: | |
image: quay.io/centos/centos:stream9 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: rpm/develop | |
- name: Install dnf-plugins-core | |
run: dnf install 'dnf-command(config-manager)' -y && dnf config-manager --set-enabled crb | |
- name: Install Required Packages | |
run: dnf install -y gobject-introspection-devel rpmdevtools rpm-build cairo-gobject-devel cairo-devel gcc make cmake postgresql-devel python3.11-devel python3.11-wheel python3.11-pip | |
- name: Add optional dependencies to requirements.txt | |
run: ./add_optional_packages.sh | |
- name: Install Pulp using requirements.txt | |
run: pip3.11 install -r $PULPCORE_REQUIREMENTS | |
- name: Collect List of packages | |
run: ./collect-pip-libs.sh > $PULPCORE_FULL_REQUIREMENTS | |
- name: Find Packages to Update | |
run: ./find_package.py < $PULPCORE_FULL_REQUIREMENTS | |
- name: Parse Package List | |
id: set-matrix | |
run: ./build_matrix_all.py < $PULPCORE_PACKAGES_TO_UPDATE | |
- name: 'Upload Full List Of Packages' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: full-package-list.txt | |
path: pulpcore-requirements.txt | |
retention-days: 14 | |
- name: 'Upload List of Packages to update' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages-to-update.txt | |
path: packages-to-update.txt | |
retention-days: 14 | |
bump-rpms: | |
name: 'Bump ${{ matrix.package_name }} RPM ${{ matrix.new_version }}' | |
needs: generate_package_list | |
if: ${{ needs.generate_package_list.outputs.matrix != '[]' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJson(needs.generate_package_list.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: rpm/develop | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y --no-install-recommends python3-rpm rpm git-annex python3-semver | |
sudo curl --create-dirs -o /usr/local/bin/spectool https://pagure.io/rpmdevtools/raw/26a8abc746fba9c0b32eb899b96c92841a37855a/f/spectool.in | |
sudo curl --create-dirs -o /usr/local/bin/rpmdev-bumpspec https://pagure.io/rpmdevtools/raw/6f387c1deaa5cbed770310e288abde04b17421dc/f/rpmdev-bumpspec | |
sudo curl --create-dirs -o /usr/local/bin/rpmdev-vercmp https://pagure.io/rpmdevtools/raw/79740e6f1881e399b0b4340a8090dd5adc91a4ea/f/rpmdev-vercmp | |
printf '#!/bin/bash\necho "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>"' | sudo tee /usr/local/bin/rpmdev-packager | |
sudo chmod +x /usr/local/bin/spectool /usr/local/bin/rpmdev-* | |
- name: Initialize git annex | |
run: git annex init | |
- name: Update Packages | |
run: ./update_packages.sh ${{ matrix.package_name }} ${{ matrix.new_version }} | |
- name: Open a PR | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "Update ${{ matrix.package_name }} to ${{ matrix.new_version }}" | |
branch: "bump_rpm/${{ matrix.package_name }}" | |
title: "Update ${{ matrix.package_name }} to ${{ matrix.new_version }}" | |
body: '' | |
delete-branch: true |