From: Alexander Fougner Date: Mon, 13 Mar 2023 17:45:15 +0000 (+0100) Subject: Add packaging workflow X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=eb13ae8d5efc3819af421fcbb36740eca5c63eef;p=bcachefs-tools-debian Add packaging workflow Package and publish deb+rpm for easy testing Signed-off-by: Alexander Fougner --- diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml new file mode 100644 index 0000000..7b829a6 --- /dev/null +++ b/.github/workflows/build-packages.yml @@ -0,0 +1,66 @@ +on: [push] + +name: build + +env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + +jobs: + + deb: + name: bcachefs-tools-deb + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-22.04] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Disable initramfs update + run: sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf + - name: Disable man-db update + run: sudo rm -f /var/lib/man-db/auto-update + - name: Install build-deps + run: | + sudo apt-get update && sudo apt-get -y install pkg-config libaio-dev libblkid-dev \ + libkeyutils-dev liblz4-dev libsodium-dev liburcu-dev libzstd-dev \ + uuid-dev zlib1g-dev valgrind libudev-dev python3-docutils \ + debhelper llvm clang libclang-dev rustc cargo \ + devscripts + - name: Setup Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Make deb + run: | + make -j`nproc` deb + mkdir dist && mv ../*.deb ./dist/ + - name: Upload deb + uses: actions/upload-artifact@v3 + with: + name: bcachefs-tools-deb_${{ matrix.os }} + path: dist + + rpm: + name: bcachefs-tools-rpm + runs-on: ubuntu-latest + container: + image: docker.io/fedora:latest + steps: + - uses: actions/checkout@v3 + - name: Install build essentials + run: dnf install -y nodejs make rpmdevtools yum-utils + - name: Setup Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Install build-deps + run: dnf builddep -y packaging/bcachefs-tools.spec + - name: Make rpm + run: | + make -j`nproc` rpm + mv ${HOME}/rpmbuild ./ + - name: Upload rpm + uses: actions/upload-artifact@v3 + with: + name: bcachefs-tools-rpm + path: rpmbuild