Skip to content

Commit

Permalink
Fix docker cross build
Browse files Browse the repository at this point in the history
  • Loading branch information
svpcom committed Nov 17, 2024
1 parent 3a1d2d9 commit 7a6109f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
fail-fast: false
matrix:
version: [11, 12]
arch: [ "arm32v7", "arm64v8", "amd64", "mips64le", "s390x", "ppc64le"]
arch: [ "armhf.arm32v7", "arm64.arm64v8", "amd64.amd64", "mips64le.mips64le", "s390x.s390x", "ppc64le.ppc64le"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: build package
run: |
curl -s -L https://github.com/svpcom/wfb-ng/releases/download/wifibroadcast-17.10/qemu-7.2.13-fixed.tar.gz | sudo tar xzv -C /
make deb_docker DOCKER_SRC_IMAGE=${{ matrix.arch }}/debian:${{ matrix.version }}
make deb_docker DOCKER_ARCH=$(echo ${{ matrix.arch}} | cut -f1 -d.) DOCKER_SRC_IMAGE=$(echo ${{ matrix.arch }} | cut -f2 -d.)/debian:${{ matrix.version }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: wfb-ng-${{ github.ref_name }}-debian${{ matrix.version }}-${{ matrix.arch }}
name: wfb-ng-${{ github.ref_name }}-debian${{ matrix.version }}-$(echo ${{ matrix.arch }} | cut -f2 -d.)
path: |
deb_dist/*.deb
- name: Output artifact URL
run: echo 'wfb-ng-${{ github.ref_name }}-debian${{ matrix.version }}-${{ matrix.arch }} ${{ steps.artifact-upload-step.outputs.artifact-url }}'
run: echo "wfb-ng-${{ github.ref_name }}-debian${{ matrix.version }}-$(echo ${{ matrix.arch }} | cut -f2 -d.) ${{ steps.artifact-upload-step.outputs.artifact-url }}"
8 changes: 4 additions & 4 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
fail-fast: false
matrix:
version: [ "20.04", "22.04", "24.04" ]
arch: [ "arm32v7", "arm64v8", "amd64"]
arch: [ "armhf.arm32v7", "arm64.arm64v8", "amd64.amd64"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: build package
run: |
curl -s -L https://github.com/svpcom/wfb-ng/releases/download/wifibroadcast-17.10/qemu-7.2.13-fixed.tar.gz | sudo tar xzv -C /
make deb_docker DOCKER_SRC_IMAGE=${{ matrix.arch }}/ubuntu:${{ matrix.version }}
make deb_docker DOCKER_ARCH=$(echo ${{ matrix.arch}} | cut -f1 -d.) DOCKER_SRC_IMAGE=$(echo ${{ matrix.arch }} | cut -f2 -d.)/ubuntu:${{ matrix.version }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: wfb-ng-${{ github.ref_name }}-ubuntu${{ matrix.version }}-${{ matrix.arch }}
name: wfb-ng-${{ github.ref_name }}-ubuntu${{ matrix.version }}-$(echo ${{ matrix.arch }} | cut -f2 -d.)
path: |
deb_dist/*.deb
- name: Output artifact URL
run: echo 'wfb-ng-${{ github.ref_name }}-ubuntu${{ matrix.version }}-${{ matrix.arch }} ${{ steps.artifact-upload-step.outputs.artifact-url }}'
run: echo "wfb-ng-${{ github.ref_name }}-ubuntu${{ matrix.version }}-$(echo ${{ matrix.arch }} | cut -f2 -d.) ${{ steps.artifact-upload-step.outputs.artifact-url }}"
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ else
endif

ENV ?= $(PWD)/env
DOCKER_ARCH ?= amd64
DOCKER_SRC_IMAGE ?= "p2ptech/cross-build:2023-02-21-raspios-bullseye-armhf-lite"
STDEB ?= "git+https://github.com/svpcom/stdeb"

Expand Down Expand Up @@ -86,6 +87,6 @@ deb_docker: /opt/qemu/bin
@if ! [ -d /opt/qemu ]; then echo "Docker cross build requires patched QEMU!\nApply ./scripts/qemu/qemu.patch to qemu-7.2.0 and build it:\n ./configure --prefix=/opt/qemu --static --disable-system && make && sudo make install"; exit 1; fi
if ! ls /proc/sys/fs/binfmt_misc | grep -q qemu ; then sudo ./scripts/qemu/qemu-binfmt-conf.sh --qemu-path /opt/qemu/bin --persistent yes; fi
cp -a Makefile docker/src/
TAG="wfb-ng:build-`date +%s`"; docker build -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \
docker run -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb"
TAG="wfb-ng:build-`date +%s`"; docker build --platform linux/$(DOCKER_ARCH) -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \
docker run --platform linux/$(DOCKER_ARCH) -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb"
docker image ls -q "wfb-ng:build-*" | uniq | tail -n+6 | while read i ; do docker rmi -f $$i; done

0 comments on commit 7a6109f

Please sign in to comment.