From b7edf31c5ae0a8a183f25cfce65212fadd5ce20e Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 2 Oct 2024 18:20:48 +0200 Subject: [PATCH] ci: add workflow for building packages Since changes such as introducing a top-level Makefile can cause a failure during building packages, we will extend our CI to test that we can successfully build packages after introducing some changes in the future. --- .github/workflows/pkg.yml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pkg.yml diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml new file mode 100644 index 00000000..3ab03981 --- /dev/null +++ b/.github/workflows/pkg.yml @@ -0,0 +1,46 @@ +name: Build packages + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLORS: always + +jobs: + build-rpm-pkgs: + name: Build rpm packages + runs-on: ubuntu-latest + + strategy: + matrix: + dist-version: [rocky-9-x86_64, fedora-40-x86_64] + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Update git safe directory config + run: git config --global --add safe.directory $(pwd) + + - name: Build rpm package for ${{ matrix.dist-version }} + run: docker run -v $(pwd):$(pwd) -w $(pwd) -t fedora:latest sudo dnf install -y git && git config --global --add safe.directory $(pwd) && ./dist/redhat/build_rpm.sh --target ${{ matrix.dist-version }} + + build-deb-pkgs: + name: Build deb packages + runs-on: ubuntu-latest + + strategy: + matrix: + dist-version: [jammy, noble] + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build deb package for ${{ matrix.dist-version }} + run: ./dist/debian/build_deb.sh --target ${{ matrix.dist-version }}