Merge branch 'develop' #24
Workflow file for this run
This file contains hidden or 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: Packaging for RPM | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.target }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - amd64 | |
| target: | |
| - almalinux:8.9 | |
| - almalinux:8.10 | |
| - almalinux:9.4 | |
| - almalinux:9.5 | |
| - almalinux:9.6 | |
| steps: | |
| - name: Extract RHEL release | |
| run: | | |
| MINOR=$(echo "${{ matrix.target }}" | grep -oP '(?<=almalinux:[89]\.)\d+') | |
| MAJOR=$(echo "${{ matrix.target }}" | grep -oP '(?<=almalinux:)[89]') | |
| echo "RHEL_RELEASE=.el${MAJOR}_${MINOR}" >> $GITHUB_ENV | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Install prereq packages | |
| run: ./rpmpkg-setup.sh ${{ matrix.target }} | |
| - name: Build packages | |
| run: ./rpmpkg-build.sh | |
| - name: Set environment variables for upload | |
| run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | |
| - name: Copy packages to uploadable location | |
| run: | | |
| mkdir -p packages/${DIRNAME} | |
| cp ~/rpmbuild/RPMS/x86_64/*.rpm packages/${DIRNAME}/ | |
| - name: Store packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages-${{ env.DIRNAME }} | |
| path: packages/${{ env.DIRNAME }}/*.rpm | |
| retention-days: 1 | |
| test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.target }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - amd64 | |
| target: | |
| - almalinux:8.9 | |
| - almalinux:8.10 | |
| - almalinux:9.4 | |
| - almalinux:9.5 | |
| - almalinux:9.6 | |
| needs: build | |
| steps: | |
| - name: Set environment variables for download | |
| run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | |
| - name: Extract RHEL release | |
| run: | | |
| MAJOR=$(echo "${{ matrix.target }}" | grep -oP '(?<=almalinux:)[89]') | |
| echo "MAJOR=${MAJOR}" >> $GITHUB_ENV | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: packages-${{ env.DIRNAME }} | |
| - name: Add repositories | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| run: | | |
| curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.rpm.sh' | bash | |
| curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.rpm.sh' | bash | |
| if [[ "${MAJOR}" == "8" ]]; then | |
| dnf config-manager --enable powertools || true | |
| dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm || true | |
| elif [[ "${MAJOR}" == "9" ]]; then | |
| dnf config-manager --enable crb || true | |
| dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm || true | |
| fi | |
| - name: Test package install | |
| run: | | |
| yum install -y findutils | |
| find . -name "*.rpm" | xargs yum install -y | |
| - name: Test package removal | |
| run: | | |
| rpm -e libtrace4-tools | |
| rpm -e libpacketdump4-devel | |
| rpm -e libtrace4-devel | |
| rpm -e libpacketdump4 | |
| rpm -e libtrace4 | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: ${{ matrix.target }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - amd64 | |
| target: | |
| - almalinux:8.9 | |
| - almalinux:8.10 | |
| - almalinux:9.4 | |
| - almalinux:9.5 | |
| - almalinux:9.6 | |
| needs: test | |
| steps: | |
| - name: Set RHEL version number | |
| run: | | |
| MINOR=$(echo "${{ matrix.target }}" | grep -oP '(?<=almalinux:[89]\.)\d+') | |
| MAJOR=$(echo "${{ matrix.target }}" | grep -oP '(?<=almalinux:)[89]') | |
| echo "MAJOR={MAJOR}" >> $GITHUB_ENV | |
| - name: Set environment variables for download | |
| run: echo DIRNAME=${{ matrix.target }} | tr ':' '_' >> $GITHUB_ENV | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: packages-${{ env.DIRNAME }} | |
| - name: Copy packages | |
| run: | | |
| mkdir -p packages/${DIRNAME} | |
| yum install -y findutils | |
| find . -name "*.rpm" | xargs cp -t packages/${DIRNAME}/ | |
| - name: Publish package to cloudsmith | |
| uses: salcock/action-cloudsmith-upload-packages@v1.8 | |
| with: | |
| path: packages/ | |
| repo: ${{ secrets.CLOUDSMITH_OWNER }}/libtrace | |
| username: salcock | |
| api_key: ${{ secrets.CLOUDSMITH_API_KEY }} | |