From 6308204224ac521e046c71a04fddf5b3511794f1 Mon Sep 17 00:00:00 2001 From: Jakub Wlodek Date: Fri, 13 Mar 2026 13:17:11 -0400 Subject: [PATCH 1/2] Simplify CI workflows with shared action --- .github/actions/build-rpm-and-srpm/action.yml | 46 +++++++++++++++++++ .github/workflows/build.yml | 34 ++------------ .github/workflows/publish-rpm.yml | 41 ++--------------- 3 files changed, 54 insertions(+), 67 deletions(-) create mode 100644 .github/actions/build-rpm-and-srpm/action.yml diff --git a/.github/actions/build-rpm-and-srpm/action.yml b/.github/actions/build-rpm-and-srpm/action.yml new file mode 100644 index 0000000..b1d8b5b --- /dev/null +++ b/.github/actions/build-rpm-and-srpm/action.yml @@ -0,0 +1,46 @@ +--- +name: Build RPM and SRPM +description: Build RPM and SRPM packages for EL8, EL9, and EL10 using GitHub Actions. +inputs: + alma_version: + description: 'The version of AlmaLinux to build for (e.g., 8, 9, or 10).' + required: true + default: '8' +runs: + using: 'composite' + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Install config-manager dnf plugin + run: | + dnf install -y 'dnf-command(config-manager)' + shell: bash + + - name: On EL8, enable PowerTools repository + if: matrix.alma_version == '8' + run: | + dnf config-manager --set-enabled powertools + shell: bash + + - name: On newer EL versions, enable CRB repository + if: matrix.alma_version != '8' + run: | + dnf config-manager --set-enabled crb + shell: bash + + - name: Enable EPEL repository + run: | + dnf install -y epel-release + shell: bash + + - name: Install dependencies + run: | + dnf install -y hdf5-devel libzstd-devel gcc make rpmdevtools + shell: bash + + - name: Build srpm and rpm + run: | + make srpm + make rpm + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d4dfea..d6d4813 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,35 +20,9 @@ jobs: image: almalinux:${{ matrix.alma_version }} options: --user root steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install config-manager dnf plugin - run: | - dnf install -y 'dnf-command(config-manager)' + - name: Build RPM and SRPM + uses: ./.github/actions/build-rpm-and-srpm + with: + alma_version: ${{ matrix.alma_version }} - - name: On EL8, enable PowerTools repository - if: matrix.alma_version == '8' - run: | - dnf config-manager --set-enabled powertools - - - name: On newer EL versions, enable CRB repository - if: matrix.alma_version != '8' - run: | - dnf config-manager --set-enabled crb - - - name: Enable EPEL repository - run: | - dnf install -y epel-release - - - name: Install dependencies - run: | - dnf install -y hdf5-devel libzstd-devel gcc make rpmdevtools - - - name: Build srpm - run: | - make srpm - - - name: Build rpm - run: | - make rpm diff --git a/.github/workflows/publish-rpm.yml b/.github/workflows/publish-rpm.yml index afe22ca..c755303 100644 --- a/.github/workflows/publish-rpm.yml +++ b/.github/workflows/publish-rpm.yml @@ -15,44 +15,11 @@ jobs: alma_version: [8, 9, 10] container: image: almalinux:${{ matrix.alma_version }} - options: --user root steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install config-manager dnf plugin - run: | - dnf install -y 'dnf-command(config-manager)' - - - name: On EL8, enable PowerTools repository - if: matrix.alma_version == '8' - run: | - dnf config-manager --set-enabled powertools - - - name: On newer EL versions, enable CRB repository - if: matrix.alma_version != '8' - run: | - dnf config-manager --set-enabled crb - - - name: Enable EPEL repository - run: | - dnf install -y epel-release - - - name: Add GitHub CLI repository - run: | - dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo - - - name: Install dependencies - run: | - dnf install -y hdf5-devel libzstd-devel gcc make rpmdevtools gh - - - name: Build srpm - run: | - make srpm - - - name: Build rpm - run: | - make rpm + - name: Build RPM and SRPM + uses: ./.github/actions/build-rpm-and-srpm + with: + alma_version: ${{ matrix.alma_version }} - name: Upload rpms to release run: | From eae9109ce973da6a22ed940bd2af27a7414c2ad4 Mon Sep 17 00:00:00 2001 From: Jakub Wlodek Date: Fri, 13 Mar 2026 13:18:30 -0400 Subject: [PATCH 2/2] Checkout has to be before calling shared action --- .github/actions/build-rpm-and-srpm/action.yml | 2 -- .github/workflows/build.yml | 2 ++ .github/workflows/publish-rpm.yml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-rpm-and-srpm/action.yml b/.github/actions/build-rpm-and-srpm/action.yml index b1d8b5b..0d4fed1 100644 --- a/.github/actions/build-rpm-and-srpm/action.yml +++ b/.github/actions/build-rpm-and-srpm/action.yml @@ -9,8 +9,6 @@ inputs: runs: using: 'composite' steps: - - name: Checkout code - uses: actions/checkout@v6 - name: Install config-manager dnf plugin run: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6d4813..901e6f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,8 @@ jobs: image: almalinux:${{ matrix.alma_version }} options: --user root steps: + - name: Checkout code + uses: actions/checkout@v6 - name: Build RPM and SRPM uses: ./.github/actions/build-rpm-and-srpm diff --git a/.github/workflows/publish-rpm.yml b/.github/workflows/publish-rpm.yml index c755303..5716286 100644 --- a/.github/workflows/publish-rpm.yml +++ b/.github/workflows/publish-rpm.yml @@ -16,6 +16,9 @@ jobs: container: image: almalinux:${{ matrix.alma_version }} steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Build RPM and SRPM uses: ./.github/actions/build-rpm-and-srpm with: