Skip to content

Commit 61ebebb

Browse files
committed
CI: Update build to work with newer docker.
1 parent a474e80 commit 61ebebb

File tree

3 files changed

+56
-57
lines changed

3 files changed

+56
-57
lines changed

.github/workflows/build-and-deploy-release.yml

+19-20
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
ext: ""
2020
- target: linux-i686
2121
os: linux
22-
arch: i686
22+
arch: i386
2323
base-image: ubuntu-latest
2424
build-image: i386/debian:stable
2525
ext: ""
2626
- target: linux-armhf
2727
os: linux
28-
arch: armhf
28+
arch: arm/v7
2929
base-image: ubuntu-latest
3030
build-image: arm32v7/debian:stable
3131
ext: ""
3232
- target: linux-aarch64
3333
os: linux
34-
arch: aarch64
34+
arch: arm64
3535
base-image: ubuntu-latest
3636
build-image: arm64v8/debian:stable
3737
ext: ""
@@ -50,27 +50,26 @@ jobs:
5050
uses: actions/checkout@v4
5151
with:
5252
submodules: true
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
if: matrix.os == 'linux'
5356
- name: Prepare Build Environemnt
5457
shell: bash
55-
run: |
56-
if ${{ matrix.os == 'linux' }}; then
57-
sudo apt-get update
58-
sudo apt-get -y install qemu-system-arm qemu-user-static
59-
else
60-
sudo apt-get update
61-
sudo apt-get -y install build-essential cmake gcc-i686-linux-gnu
62-
sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
63-
sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
64-
fi
58+
run: sudo apt-get update -qq && sudo apt-get -qq --no-install-recommends install build-essential cmake gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
59+
if: matrix.os == 'windows'
6560
- name: Build
66-
shell: bash
6761
run: |
68-
if ${{ matrix.os == 'linux' }}; then
69-
docker pull ${{ matrix.build-image }}
70-
docker run --net=host --rm --device /dev/fuse -v $PWD:/mvdsv ${{ matrix.build-image }} bash -c -e 'export ARCH=$(dpkg --print-architecture);export DEBIAN_FRONTEND=noninteractive;mkdir -p /etc/apt/apt.conf.d;echo "APT::Install-Recommends "0"; APT::AutoRemove::RecommendsImportant "false";" >> /etc/apt/apt.conf.d/01lean && apt-get -qqy update && apt-get -qqy dist-upgrade && apt-get -qqy install cmake build-essential libcurl4-openssl-dev && ln -sf "$(which make)" /usr/bin/gmake && cd /mvdsv && ./build_cmake.sh ${{ matrix.target }} && chown -R '$(id -u ${USER})':'$(id -g ${USER})' /mvdsv/build/${{ matrix.target }}||exit 3'
71-
else
72-
./build_cmake.sh ${{ matrix.target }}
73-
fi
62+
if ${{ matrix.os == 'linux' }}; then
63+
docker run --platform linux/${{ matrix.arch }} --net=host --rm --device /dev/fuse -v $PWD:/mvdsv -w /mvdsv ${{ matrix.build-image }} bash -c -e '
64+
set -e
65+
apt-get -qq update
66+
apt-get -qq --no-install-recommends install cmake build-essential libcurl4-openssl-dev ninja-build
67+
./build_cmake.sh ${{ matrix.target }}
68+
chown -R '$(id -u ${USER})':'$(id -g ${USER})' build/${{ matrix.target }} || exit 3
69+
'
70+
else
71+
./build_cmake.sh ${{ matrix.target }}
72+
fi
7473
- name: Create checksum
7574
run: |
7675
md5sum build/${{ matrix.target }}/mvdsv${{ matrix.ext }} > build/${{ matrix.target }}/mvdsv.md5

.github/workflows/build-and-deploy-snapshot.yml

+19-20
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
ext: ""
1818
- target: linux-i686
1919
os: linux
20-
arch: i686
20+
arch: i386
2121
base-image: ubuntu-latest
2222
build-image: i386/debian:stable
2323
ext: ""
2424
- target: linux-armhf
2525
os: linux
26-
arch: armhf
26+
arch: arm/v7
2727
base-image: ubuntu-latest
2828
build-image: arm32v7/debian:stable
2929
ext: ""
3030
- target: linux-aarch64
3131
os: linux
32-
arch: aarch64
32+
arch: arm64
3333
base-image: ubuntu-latest
3434
build-image: arm64v8/debian:stable
3535
ext: ""
@@ -48,27 +48,26 @@ jobs:
4848
uses: actions/checkout@v4
4949
with:
5050
submodules: true
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v3
53+
if: matrix.os == 'linux'
5154
- name: Prepare Build Environemnt
5255
shell: bash
53-
run: |
54-
if ${{ matrix.os == 'linux' }}; then
55-
sudo apt-get update
56-
sudo apt-get -y install qemu-system-arm qemu-user-static
57-
else
58-
sudo apt-get update
59-
sudo apt-get -y install build-essential cmake gcc-i686-linux-gnu
60-
sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
61-
sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
62-
fi
56+
run: sudo apt-get update -qq && sudo apt-get -qq --no-install-recommends install build-essential cmake gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
57+
if: matrix.os == 'windows'
6358
- name: Build
64-
shell: bash
6559
run: |
66-
if ${{ matrix.os == 'linux' }}; then
67-
docker pull ${{ matrix.build-image }}
68-
docker run --net=host --rm --device /dev/fuse -v $PWD:/mvdsv ${{ matrix.build-image }} bash -c -e 'export ARCH=$(dpkg --print-architecture);export DEBIAN_FRONTEND=noninteractive;mkdir -p /etc/apt/apt.conf.d;echo "APT::Install-Recommends "0"; APT::AutoRemove::RecommendsImportant "false";" >> /etc/apt/apt.conf.d/01lean && apt-get -qqy update && apt-get -qqy dist-upgrade && apt-get -qqy install cmake build-essential libcurl4-openssl-dev && ln -sf "$(which make)" /usr/bin/gmake && cd /mvdsv && ./build_cmake.sh ${{ matrix.target }} && chown -R '$(id -u ${USER})':'$(id -g ${USER})' /mvdsv/build/${{ matrix.target }}||exit 3'
69-
else
70-
./build_cmake.sh ${{ matrix.target }}
71-
fi
60+
if ${{ matrix.os == 'linux' }}; then
61+
docker run --platform linux/${{ matrix.arch }} --net=host --rm --device /dev/fuse -v $PWD:/mvdsv -w /mvdsv ${{ matrix.build-image }} bash -c -e '
62+
set -e
63+
apt-get -qq update
64+
apt-get -qq --no-install-recommends install cmake build-essential libcurl4-openssl-dev ninja-build
65+
./build_cmake.sh ${{ matrix.target }}
66+
chown -R '$(id -u ${USER})':'$(id -g ${USER})' build/${{ matrix.target }} || exit 3
67+
'
68+
else
69+
./build_cmake.sh ${{ matrix.target }}
70+
fi
7271
- name: Create checksum
7372
run: |
7473
md5sum build/${{ matrix.target }}/mvdsv${{ matrix.ext }} > build/${{ matrix.target }}/mvdsv.md5

.github/workflows/build-targets.yml

+18-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: build targets
22
on: [push,pull_request]
33
jobs:
44
build:
5-
if: github.repository == 'QW-Group/mvdsv'
65
runs-on: ${{ matrix.base-image }}
76
strategy:
87
fail-fast: false
@@ -17,19 +16,19 @@ jobs:
1716
ext: ""
1817
- target: linux-i686
1918
os: linux
20-
arch: i686
19+
arch: i386
2120
base-image: ubuntu-latest
2221
build-image: i386/debian:stable
2322
ext: ""
2423
- target: linux-armhf
2524
os: linux
26-
arch: armhf
25+
arch: arm/v7
2726
base-image: ubuntu-latest
2827
build-image: arm32v7/debian:stable
2928
ext: ""
3029
- target: linux-aarch64
3130
os: linux
32-
arch: aarch64
31+
arch: arm64
3332
base-image: ubuntu-latest
3433
build-image: arm64v8/debian:stable
3534
ext: ""
@@ -48,24 +47,26 @@ jobs:
4847
uses: actions/checkout@v4
4948
with:
5049
submodules: true
50+
51+
- name: Set up QEMU
52+
uses: docker/setup-qemu-action@v3
53+
if: matrix.os == 'linux'
54+
5155
- name: Prepare Build Environemnt
5256
shell: bash
53-
run: |
54-
if ${{ matrix.os == 'linux' }}; then
55-
sudo apt-get update
56-
sudo apt-get -y install qemu-system-arm qemu-user-static
57-
else
58-
sudo apt-get update
59-
sudo apt-get -y install build-essential cmake gcc-i686-linux-gnu
60-
sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
61-
sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
62-
fi
57+
run: sudo apt-get update -qq && sudo apt-get -qq --no-install-recommends install build-essential cmake gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
58+
if: matrix.os == 'windows'
59+
6360
- name: Build
64-
shell: bash
6561
run: |
6662
if ${{ matrix.os == 'linux' }}; then
67-
docker pull ${{ matrix.build-image }}
68-
docker run --net=host --rm --device /dev/fuse -v $PWD:/mvdsv ${{ matrix.build-image }} bash -c -e 'export ARCH=$(dpkg --print-architecture);export DEBIAN_FRONTEND=noninteractive;mkdir -p /etc/apt/apt.conf.d;echo "APT::Install-Recommends "0"; APT::AutoRemove::RecommendsImportant "false";" >> /etc/apt/apt.conf.d/01lean && apt-get -qqy update && apt-get -qqy dist-upgrade && apt-get -qqy install cmake build-essential libcurl4-openssl-dev && ln -sf "$(which make)" /usr/bin/gmake && cd /mvdsv && ./build_cmake.sh ${{ matrix.target }} && chown -R '$(id -u ${USER})':'$(id -g ${USER})' /mvdsv/build/${{ matrix.target }}||exit 3'
63+
docker run --platform linux/${{ matrix.arch }} --net=host --rm --device /dev/fuse -v $PWD:/mvdsv -w /mvdsv ${{ matrix.build-image }} bash -c -e '
64+
set -e
65+
apt-get -qq update
66+
apt-get -qq --no-install-recommends install cmake build-essential libcurl4-openssl-dev ninja-build
67+
./build_cmake.sh ${{ matrix.target }}
68+
chown -R '$(id -u ${USER})':'$(id -g ${USER})' build/${{ matrix.target }} || exit 3
69+
'
6970
else
7071
./build_cmake.sh ${{ matrix.target }}
7172
fi

0 commit comments

Comments
 (0)