From a4cf5cfccabeda0d854685f7d218aa799e1055c0 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 6 Apr 2026 21:03:45 +0300 Subject: [PATCH] build rpm for arm64 --- .github/workflows/build-rpm-arm64.yml | 72 +++++++++++++++++++++++++++ .github/workflows/build-rpm.yml | 71 -------------------------- 2 files changed, 72 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/build-rpm-arm64.yml delete mode 100644 .github/workflows/build-rpm.yml diff --git a/.github/workflows/build-rpm-arm64.yml b/.github/workflows/build-rpm-arm64.yml new file mode 100644 index 0000000..d509025 --- /dev/null +++ b/.github/workflows/build-rpm-arm64.yml @@ -0,0 +1,72 @@ +name: RPM build arm + +on: + push: + branches: [ "master" ] + paths: [ 'RELEASE', '.github/workflows/build-rpm-arm64.yml' ] + +jobs: + ci: + name: "${{ matrix.target }}" + strategy: + matrix: + target: + - ubuntu-latest + runs-on: ${{ matrix.target }} + steps: + - uses: actions/checkout@v4 + - name: env + run: | + pwd + echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV + echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV + echo "MAJOR=$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV + echo "SUBMAJOR=$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV + echo "MINOR=$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV + - name: Linux libraries + run: | + sudo apt update + sudo dpkg --add-architecture arm64 + echo "Types: deb" > ~/ubuntu.sources + echo "URIs: http://archive.ubuntu.com/ubuntu/" >> ~/ubuntu.sources + echo "Suites: noble noble-updates noble-backports" >> ~/ubuntu.sources + echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources + echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources + echo "Architectures: amd64" >> ~/ubuntu.sources + echo "" >> ~/ubuntu.sources + echo "Types: deb" >> ~/ubuntu.sources + echo "URIs: http://security.ubuntu.com/ubuntu/" >> ~/ubuntu.sources + echo "Suites: noble-security" >> ~/ubuntu.sources + echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources + echo "Architectures: amd64" >> ~/ubuntu.sources + echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources + echo "" >> ~/ubuntu.sources + echo "Types: deb" >>~/ubuntu.sources + echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >>~/ubuntu.sources + echo "Suites: noble noble-updates" >>~/ubuntu.sources + echo "Components: main restricted universe multiverse" >>~/ubuntu.sources + echo "Architectures: arm64" >>~/ubuntu.sources + echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/ubuntu.sources + sudo cp ~/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources + sudo apt update + sudo apt install libssl-dev:arm64 libpam0g:arm64 libpam0g-dev:arm64 libpcre2-dev:arm64 rpm crossbuild-essential-arm64 + - name: make rpmbuild dir + run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + - name: configure rpm env + run: | + tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," . + ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz + cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec + - name: rpmbuild + run: | + ret=`pwd` + cd ~/rpmbuild/SPECS + rpmbuild -ba --define "PAMLIB pam0g" --define "_arch aarch64" --define "cross yes" --target=aarch64-linux-gnueabi 3proxy-$RELEASE.spec + cd $ret + mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.arm64.rpm + - name: Get artifact + uses: actions/upload-artifact@v4 + with: + name: "3proxy-${{ env.RELEASE }}-arm64.rpm" + path: "*.rpm" + diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml deleted file mode 100644 index ca00689..0000000 --- a/.github/workflows/build-rpm.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: RPM build - -on: - push: - branches: [ "master" ] - paths: [ 'RELEASE', '.github/workflows/build-rpm.yml' ] - -jobs: - ci: - name: "${{ matrix.target }}" - strategy: - matrix: - target: - - ubuntu-latest - runs-on: ${{ matrix.target }} - steps: - - uses: actions/checkout@v4 - - name: env - run: | - pwd - echo "RELEASE==$(cat RELEASE)" >> $GITHUB_ENV - echo "VERSION==$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV - echo "MAJOR==$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV - echo "SUBMAJOR==$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV - echo "MINOR==$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV - - name: echo env - run: echo "release $RELEASE version $VERSION major $MAJOR submajor $SUBMAJOR minor $MINOR" - - name: Linux libraries - run: | - sudo apt update - sudo dpkg --add-architecture arm64 - sudo dpkg --add-architecture armhf - echo "Types: deb" >~/arm64.sources - echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >>~/arm64.sources - echo "Suites: noble noble-updates noble-security" >>~/arm64.sources - echo "Components: main restricted universe multiverse" >>~/arm64.sources - echo "rchitectures: arm64" >>~/arm64.sources - echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/arm64.sources - sudo cp ~/arm64.sources /etc/apt/sources.list.d/arm64.sources - cat /etc/apt/sources.list.d/arm64.sources - echo "Types: deb" >~/armhf.sources - echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >>~/armhf.sources - echo "Suites: noble noble-updates noble-security" >>~/armhf.sources - echo "Components: main restricted universe multiverse" >>~/armhf.sources - echo "rchitectures: armhf" >>~/armhf.sources - echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/armhf.sources - sudo cp ~/armhf.sources /etc/apt/sources.list.d/armhf.sources - sudo apt update - sudo apt install libssl-dev libpam-dev libpcre2-dev libssl-dev:arm64 libpam-dev:arm64 libpcre2-dev:arm64 libssl-dev:armhf libpam-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-arm64 crossbuild-essential-armhf - - name: make rpmbuild dir - run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} - - name: configure rpm env - run: | - git archive --format=tar --prefix=3proxy-$RELEASE/ master | gzip >~/rpmbuilds/SOURCES/3proxy-$RELEASE.tar.gz - cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec - - name: rpmbuild - run: | - ret=`pwd` - cd ~/rpmbuild/SPECS - rpmbuild --define "devel_version $VERSION" -ba 3proxy-$RELEASE.spec - rpmbuild -ba --define "devel_version $VERSION" --define "_arch arm" --define "cross yes" --target=arm-linux-gnueabi 3proxy-$RELEASE.spec - rpmbuild -ba --define "devel_version $VERSION" --define "_arch aarch64" --define "cross yes" --target=aarch64-linux-gnu 3proxy-$RELEASE.spec - cd $ret - mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm ../3proxy-$RELEASE.x86_64.rpm - mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm ../3proxy-$RELEASE.arm.rpm - mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm ../3proxy-$RELEASE.aarch64.rpm - - name: Get artifact - uses: actions/upload-artifact@v4 - with: - name: "3proxy-${{ env.RELEASE }}-rpm" - path: "*.rpm"