From 5fc1df20434fb7c1c02454f20c3177bf0fe76d6c Mon Sep 17 00:00:00 2001 From: Kron4ek Date: Tue, 23 May 2023 19:39:24 +0500 Subject: [PATCH] Configure Github Actions Github Actions will build Conty weekly and utils monthly. --- .github/workflows/conty.yml | 24 ++++++++++++++++ .github/workflows/utils.yml | 57 +++++++++++++++++++++++++++++++++++++ create-arch-bootstrap.sh | 21 +++++++++----- create-utils.sh | 13 ++++++++- 4 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/conty.yml create mode 100644 .github/workflows/utils.yml diff --git a/.github/workflows/conty.yml b/.github/workflows/conty.yml new file mode 100644 index 0000000..49de3ea --- /dev/null +++ b/.github/workflows/conty.yml @@ -0,0 +1,24 @@ +name: Conty CI + +on: + schedule: + - cron: '0 0 * * 5' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Build Conty + run: | + chmod +x create-arch-bootstrap.sh create-conty.sh + sed -i 's/sed/#sed/g' create-arch-bootstrap.sh + sudo ./create-arch-bootstrap.sh && ./create-conty.sh + + - uses: actions/upload-artifact@v3 + with: + name: Conty + path: conty.sh diff --git a/.github/workflows/utils.yml b/.github/workflows/utils.yml new file mode 100644 index 0000000..305dba2 --- /dev/null +++ b/.github/workflows/utils.yml @@ -0,0 +1,57 @@ +name: Utils CI + +on: + schedule: + - cron: '0 0 1 * *' + push: + paths: + - 'create-utils.sh' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + container: archlinux:latest + + steps: + - uses: actions/checkout@v3 + + - name: Compile utils + run: | + chmod +x create-utils.sh + pacman -Syu --noconfirm --needed base-devel gawk grep lz4 zstd \ + curl gcc make autoconf libtool pkgconf libcap fuse2 lzo \ + xz zlib findutils openssl jemalloc xxhash boost lz4 xz \ + zstd libarchive libunwind google-glog gtest fmt gflags \ + double-conversion cmake ruby-ronn libevent libdwarf git \ + clang libsodium liburing libaio + build_dwarfs=false ./create-utils.sh + tar xf utils.tar.gz + mv utils utils-bak + pacman -Rdd --noconfirm fuse2 + pacman -S --noconfirm fuse3 + build_dwarfs=false ./create-utils.sh + tar xf utils.tar.gz + rm utils.tar.gz + mv utils-bak/* utils + tar -zcf utils.tar.gz utils + rm -rf utils utils-bak + + build_dwarfs=true ./create-utils.sh + tar xf utils_dwarfs.tar.gz + rm utils_dwarfs.tar.gz + mv utils utils-bak + pacman -Rdd --noconfirm fuse3 + pacman -S --noconfirm fuse2 + build_dwarfs=true ./create-utils.sh + tar xf utils_dwarfs.tar.gz + rm utils_dwarfs.tar.gz + mv utils-bak/* utils + tar -zcf utils_dwarfs.tar.gz utils + + - uses: actions/upload-artifact@v3 + with: + name: Utils + path: | + utils.tar.gz + utils_dwarfs.tar.gz diff --git a/create-arch-bootstrap.sh b/create-arch-bootstrap.sh index 7b06cf7..4cdb90c 100755 --- a/create-arch-bootstrap.sh +++ b/create-arch-bootstrap.sh @@ -155,12 +155,12 @@ if [ ! -s chaotic-keyring.pkg.tar.zst ] || [ ! -s chaotic-mirrorlist.pkg.tar.zst exit 1 fi -bootstrap_urls=("mirror.cyberbits.eu" \ - "arch.hu.fo" \ - "mirror.f4st.host" \ - "mirror.osbeck.com" \ - "mirror.lcarilla.de" \ - "mirror.moson.org") +bootstrap_urls=("mirror.f4st.host" \ + "arch.hu.fo" \ + "mirror.cyberbits.eu" \ + "mirror.osbeck.com" \ + "mirror.lcarilla.de" \ + "mirror.moson.org") echo "Downloading Arch Linux bootstrap" @@ -186,6 +186,7 @@ if [ -z "${bootstrap_is_good}" ]; then exit 1 fi +rm -rf "${bootstrap}" tar xf archlinux-bootstrap-x86_64.tar.gz rm archlinux-bootstrap-x86_64.tar.gz sha256sums.txt sha256.txt @@ -255,13 +256,19 @@ if [ -n "\${bad_pkglist}" ]; then echo \${bad_pkglist} > /opt/bad_pkglist.txt fi -pacman --noconfirm --needed -S \${good_pkglist} || pacman --noconfirm --needed -S \${good_pkglist} +pacman --noconfirm --needed -S \${good_pkglist} || pacman --noconfirm --needed -S \${good_pkglist} || echo > /opt/pacman_failed.txt EOF chmod +x "${bootstrap}"/opt/install_packages.sh run_in_chroot bash /opt/install_packages.sh rm "${bootstrap}"/opt/install_packages.sh +if [ -f "${bootstrap}"/opt/pacman_failed.txt ]; then + unmount_chroot + echo "Pacman failed to install some packages" + exit 1 +fi + run_in_chroot locale-gen # Generate a list of installed packages diff --git a/create-utils.sh b/create-utils.sh index f29aa49..a34c1ef 100755 --- a/create-utils.sh +++ b/create-utils.sh @@ -12,7 +12,7 @@ script_dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" # Set to true to compile dwarfs instead of squashfuse -build_dwarfs="false" +build_dwarfs="${build_dwarfs:-false}" squashfuse_version="0.1.105" bwrap_version="0.8.0" @@ -96,6 +96,11 @@ if ! ldd utils/squashfuse | grep -q libfuse.so.2; then fi if [ "${build_dwarfs}" = "true" ]; then + if command -v clang++ 1>/dev/null; then + export CC=clang + export CXX=clang++ + fi + git clone https://github.com/mhx/dwarfs.git --recursive # Revert commit aeeddae, because otherwise dwarfs might use @@ -107,6 +112,12 @@ if [ "${build_dwarfs}" = "true" ]; then cd dwarfs || exit 1 git revert --no-commit aeeddaecab5d4648780b0e11dc03fca19e23409a + # Fix compilation with GCC 13 + cd folly + curl -#Lo gcc13.patch https://github.com/facebook/folly/commit/39d0cbd592a4d57c34bbf3c751ecd9a4055fbc45.patch + patch -Np1 < ./gcc13.patch || exit 1 + cd .. + mkdir build cd build || exit 1 cmake .. -DCMAKE_BUILD_TYPE=Release \