diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index 45b7bc3..c48f9d8 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -147,14 +147,18 @@ jobs: container: image: ${{ matrix.distro }} steps: - - name: Update yum mirror + - name: Install dependencies run: | set -e set -x - # replace the mirror + # Speed up package installation sed -i -E 's|https?://mirrors.openanolis.cn/anolis/|https://mirrors.aliyun.com/anolis/|g' /etc/yum.repos.d/*.repo sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo + sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf + if ! grep -q "^max_parallel_downloads=" /etc/yum.conf; then + sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf + fi # update packages yum update -y diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 94f9f5a..d82decd 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -21,14 +21,18 @@ jobs: container: image: alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest steps: - - name: Update yum mirror + - name: Install dependencies run: | set -e set -x - # replace the mirror + # Speed up package installation sed -i -E 's|https?://mirrors.openanolis.cn/anolis/|https://mirrors.aliyun.com/anolis/|g' /etc/yum.repos.d/*.repo sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo + sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf + if ! grep -q "^max_parallel_downloads=" /etc/yum.conf; then + sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf + fi # install development tools yum install -y autoconf automake binutils bison flex gcc gcc-c++ gdb glibc-devel libtool make pkgconf pkgconf-m4 pkgconf-pkg-config rpm-build rpm-sign strace asciidoc byacc ctags diffstat elfutils-libelf-devel git intltool patchutils perl-Fedora-VSP perl-Sys-Syslog perl-generators pesign source-highlight systemtap valgrind valgrind-devel cmake expect rpmdevtools rpmlint perl clang diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05f3dc8..1c270c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,14 +33,18 @@ jobs: - /dev:/dev options: --privileged --ipc=host steps: - - name: Update yum mirror + - name: Install dependencies run: | set -e set -x - # replace the mirror + # Speed up package installation sed -i -E 's|https?://mirrors.openanolis.cn/anolis/|https://mirrors.aliyun.com/anolis/|g' /etc/yum.repos.d/*.repo sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo + sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf + if ! grep -q "^max_parallel_downloads=" /etc/yum.conf; then + sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf + fi # update packages yum update -y diff --git a/Makefile b/Makefile index 7a4f60d..4075c14 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ rpm-build-in-al3-docker: mkdir -p ~/rpmbuild/SOURCES/ cp /tmp/cryptpilot-${VERSION}-vendored-source.tar.gz ~/rpmbuild/SOURCES/ - docker run --rm -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest bash -x -c "sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo ; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" + docker run --rm -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest bash -x -c "sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo ; sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf ; if ! grep -q '^max_parallel_downloads=' /etc/yum.conf; then sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf; fi ; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" .PHONE: rpm-build-in-an23-docker rpm-build-in-an23-docker: @@ -103,7 +103,7 @@ rpm-build-in-an23-docker: mkdir -p ~/rpmbuild/SOURCES/ cp /tmp/cryptpilot-${VERSION}-vendored-source.tar.gz ~/rpmbuild/SOURCES/ - docker run --rm -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code registry.openanolis.cn/openanolis/anolisos:23 bash -x -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" + docker run --rm -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code registry.openanolis.cn/openanolis/anolisos:23 bash -x -c "sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf ; if ! grep -q '^max_parallel_downloads=' /etc/yum.conf; then sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf; fi ; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" .PHONE: rpm-build-in-docker rpm-build-in-docker: rpm-build-in-al3-docker @@ -114,7 +114,7 @@ rpm-build-in-docker-aarch64: mkdir -p ~/rpmbuild/SOURCES/ cp /tmp/cryptpilot-${VERSION}-vendored-source.tar.gz ~/rpmbuild/SOURCES/ - docker run --rm --platform linux/arm64 -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest bash -x -c "sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo ; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" + docker run --rm --platform linux/arm64 -v ~/rpmbuild:/root/rpmbuild -v .:/code --workdir=/code alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:latest bash -x -c "sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo ; sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf ; if ! grep -q '^max_parallel_downloads=' /etc/yum.conf; then sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf; fi ; curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none ; source \"\$$HOME/.cargo/env\" ; yum install -y rpmdevtools yum-utils; rpmdev-setuptree ; yum-builddep -y --skip-unavailable ./cryptpilot.spec ; rpmbuild -ba ./cryptpilot.spec --define 'with_rustup 1'" .PHONE: rpm-install rpm-install: rpm-build diff --git a/rpm/alinux3/cryptpilot.al8.aarch64.buildspec.yaml.template b/rpm/alinux3/cryptpilot.al8.aarch64.buildspec.yaml.template index c6a255d..c273ac3 100644 --- a/rpm/alinux3/cryptpilot.al8.aarch64.buildspec.yaml.template +++ b/rpm/alinux3/cryptpilot.al8.aarch64.buildspec.yaml.template @@ -46,6 +46,9 @@ phases: - rustup default 1.91.1 # Change yum source from Anolis to Alinux - sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo + # Configure yum for faster downloads + - sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf + - if ! grep -q "^max_parallel_downloads=" /etc/yum.conf; then sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf; fi build: commands: - rpmbuild --define "_topdir /tmp/rpmbuild" -ba /tmp/rpmbuild/SPECS/cryptpilot.spec --define 'with_rustup 1' diff --git a/rpm/alinux3/cryptpilot.al8.x86_64.buildspec.yaml.template b/rpm/alinux3/cryptpilot.al8.x86_64.buildspec.yaml.template index da5f152..0737607 100644 --- a/rpm/alinux3/cryptpilot.al8.x86_64.buildspec.yaml.template +++ b/rpm/alinux3/cryptpilot.al8.x86_64.buildspec.yaml.template @@ -46,6 +46,9 @@ phases: - rustup default 1.91.1 # Change yum source from Anolis to Alinux - sed -i -E 's|https?://mirrors.cloud.aliyuncs.com/|https://mirrors.aliyun.com/|g' /etc/yum.repos.d/*.repo + # Configure yum for faster downloads + - sed -i 's/^max_parallel_downloads=.*/max_parallel_downloads=20/' /etc/yum.conf + - if ! grep -q "^max_parallel_downloads=" /etc/yum.conf; then sed -i '/^\[main\]$/a max_parallel_downloads=20' /etc/yum.conf; fi build: commands: - rpmbuild --define "_topdir /tmp/rpmbuild" -ba /tmp/rpmbuild/SPECS/cryptpilot.spec --define 'with_rustup 1'