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..0d4fed1 --- /dev/null +++ b/.github/actions/build-rpm-and-srpm/action.yml @@ -0,0 +1,44 @@ +--- +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: 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..901e6f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,34 +21,10 @@ jobs: options: --user root steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - 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..5716286 100644 --- a/.github/workflows/publish-rpm.yml +++ b/.github/workflows/publish-rpm.yml @@ -15,44 +15,14 @@ jobs: alma_version: [8, 9, 10] container: image: almalinux:${{ matrix.alma_version }} - options: --user root steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - 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: |