Fix package rename script - cargo-deb already includes architecture in filename
This commit is contained in:
parent
64b641368c
commit
512913e897
56
.github/workflows/build-deb.yml
vendored
56
.github/workflows/build-deb.yml
vendored
@ -26,6 +26,10 @@ jobs:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
- target: aarch64-unknown-linux-gnu
|
- target: aarch64-unknown-linux-gnu
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
- target: armv7-unknown-linux-gnueabihf
|
||||||
|
arch: armhf
|
||||||
|
- target: riscv64gc-unknown-linux-gnu
|
||||||
|
arch: riscv64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@ -50,6 +54,18 @@ jobs:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||||
|
|
||||||
|
- name: Install cross-compilation tools (ARMhf)
|
||||||
|
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
|
||||||
|
|
||||||
|
- name: Install cross-compilation tools (RISC-V)
|
||||||
|
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y gcc-riscv64-linux-gnu libc6-dev-riscv64-cross
|
||||||
|
|
||||||
- name: Configure cross-compilation (ARM64)
|
- name: Configure cross-compilation (ARM64)
|
||||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
run: |
|
run: |
|
||||||
@ -59,6 +75,24 @@ jobs:
|
|||||||
linker = "aarch64-linux-gnu-gcc"
|
linker = "aarch64-linux-gnu-gcc"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
- name: Configure cross-compilation (ARMhf)
|
||||||
|
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
|
||||||
|
run: |
|
||||||
|
mkdir -p .cargo
|
||||||
|
cat >> .cargo/config.toml << EOF
|
||||||
|
[target.armv7-unknown-linux-gnueabihf]
|
||||||
|
linker = "arm-linux-gnueabihf-gcc"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Configure cross-compilation (RISC-V)
|
||||||
|
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
mkdir -p .cargo
|
||||||
|
cat >> .cargo/config.toml << EOF
|
||||||
|
[target.riscv64gc-unknown-linux-gnu]
|
||||||
|
linker = "riscv64-linux-gnu-gcc"
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@ -85,18 +119,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo deb --package socktop_agent --target ${{ matrix.target }} --no-strip
|
cargo deb --package socktop_agent --target ${{ matrix.target }} --no-strip
|
||||||
|
|
||||||
- name: Rename packages with architecture
|
- name: Copy packages to debs directory
|
||||||
run: |
|
run: |
|
||||||
mkdir -p debs
|
mkdir -p debs
|
||||||
cp target/${{ matrix.target }}/debian/*.deb debs/
|
cp target/${{ matrix.target }}/debian/*.deb debs/
|
||||||
cd debs
|
|
||||||
for deb in *.deb; do
|
|
||||||
# Extract package info
|
|
||||||
pkg_name=$(echo $deb | cut -d_ -f1)
|
|
||||||
version=$(echo $deb | cut -d_ -f2)
|
|
||||||
# Rename to include arch
|
|
||||||
mv "$deb" "${pkg_name}_${version}_${{ matrix.arch }}.deb"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: List generated packages
|
- name: List generated packages
|
||||||
run: ls -lh debs/
|
run: ls -lh debs/
|
||||||
@ -127,6 +153,18 @@ jobs:
|
|||||||
name: debian-packages-arm64
|
name: debian-packages-arm64
|
||||||
path: all-debs
|
path: all-debs
|
||||||
|
|
||||||
|
- name: Download ARMhf packages
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: debian-packages-armhf
|
||||||
|
path: all-debs
|
||||||
|
|
||||||
|
- name: Download RISC-V packages
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: debian-packages-riscv64
|
||||||
|
path: all-debs
|
||||||
|
|
||||||
- name: List all packages
|
- name: List all packages
|
||||||
run: |
|
run: |
|
||||||
echo "All generated .deb packages:"
|
echo "All generated .deb packages:"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user