diff --git a/.github/workflows/cpp-cross-linux-arm.yml b/.github/workflows/cpp-cross-linux-arm.yml index 37be3658..6c421f3e 100644 --- a/.github/workflows/cpp-cross-linux-arm.yml +++ b/.github/workflows/cpp-cross-linux-arm.yml @@ -45,6 +45,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch --prune --unshallow --tags - name: pkg run: | diff --git a/.github/workflows/cpp-docker.yml b/.github/workflows/cpp-docker.yml index 87dc0da6..15d42d0e 100644 --- a/.github/workflows/cpp-docker.yml +++ b/.github/workflows/cpp-docker.yml @@ -36,6 +36,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch --prune --unshallow --tags - name: Build an image from Dockerfile run: | diff --git a/.github/workflows/cpp-linux.yml b/.github/workflows/cpp-linux.yml index 06503da3..33e5712b 100644 --- a/.github/workflows/cpp-linux.yml +++ b/.github/workflows/cpp-linux.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch --prune --unshallow --tags - name: pkg run: sudo apt-get update && sudo apt-get install -y --no-install-recommends g++ autoconf automake libtool xz-utils libasound2-dev libpulse-dev libgtk-3-dev cmake p7zip-full diff --git a/.github/workflows/cpp-macos.yml b/.github/workflows/cpp-macos.yml index 03cc011f..2884b724 100644 --- a/.github/workflows/cpp-macos.yml +++ b/.github/workflows/cpp-macos.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch --prune --unshallow --tags - name: pkg run: brew install cmake p7zip gcc openssl rtmpdump && brew link --force openssl diff --git a/.github/workflows/cpp-windows.yml b/.github/workflows/cpp-windows.yml index 1eab381a..22be9ae4 100644 --- a/.github/workflows/cpp-windows.yml +++ b/.github/workflows/cpp-windows.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 + - run: git fetch --prune --unshallow --tags - name: pkg shell: cmd diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index 148314fb..605bbb59 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -8,7 +8,8 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-tags: true + - name: Login to GitHub Container Registry uses: docker/login-action@v3 diff --git a/Dockerfile b/Dockerfile index 3c914046..847e4461 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,9 @@ FROM ubuntu:24.04 AS builder LABEL maintainer=michel.promonet@free.fr ARG USERNAME=dev -WORKDIR /webrtc-streamer -COPY . /webrtc-streamer +WORKDIR /build/webrtc-streamer + +COPY . . ENV PATH /depot_tools:$PATH @@ -12,22 +13,22 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME \ && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools \ - && mkdir /webrtc \ - && cd /webrtc \ + && mkdir ../webrtc \ + && cd ../webrtc \ && fetch --no-history --nohooks webrtc \ && sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS \ && gclient sync \ - && cd /webrtc-streamer \ - && cmake . && make \ - && cpack \ - && mkdir /app && tar xvzf webrtc-streamer*.tar.gz --strip=1 -C /app/ && rm webrtc-streamer*.tar.gz \ - && rm -rf /webrtc/src/out \ + && cd ../webrtc-streamer \ + && cmake -DCMAKE_INSTALL_PREFIX=/app . && make \ + && make install \ + && rm -rf ../webrtc/src/out \ && apt-get clean && rm -rf /var/lib/apt/lists/ # run FROM ubuntu:24.04 -WORKDIR /app +WORKDIR /app/webrtc-streamer + COPY --from=builder /app/ /app/ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libssl-dev libasound2-dev libgtk-3-0 libxtst6 libpulse0 librtmp1 avahi-utils \ diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 15e6cc32..ce643e54 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -4,29 +4,31 @@ ARG IMAGE=arm64v8/ubuntu FROM ubuntu:24.04 AS builder LABEL maintainer=michel.promonet@free.fr -WORKDIR /webrtc-streamer -COPY . /webrtc-streamer +WORKDIR /build/webrtc-streamer + +COPY . . + +ENV PATH /depot_tools:$PATH RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates wget git python3 python3-pkg-resources xz-utils cmake make pkg-config gcc-aarch64-linux-gnu g++-aarch64-linux-gnu build-essential \ - && mkdir /webrtc \ && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools \ - && export PATH=/depot_tools:$PATH \ - && cd /webrtc \ + && mkdir ../webrtc \ + && cd ../webrtc \ && fetch --no-history --nohooks webrtc \ && sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS \ && src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 \ && gclient sync \ - && cd /webrtc-streamer \ - && cmake -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ - && cpack \ - && mkdir /app && tar xvzf webrtc-streamer*.tar.gz --strip=1 -C /app/ \ - && rm -rf /webrtc && rm -f *.a && rm -f src/*.o \ + && cd ../webrtc-streamer \ + && cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ + && make install \ + && rm -rf ../webrtc && rm -f *.a && rm -f src/*.o \ && apt-get clean && rm -rf /var/lib/apt/lists/ # run FROM $IMAGE -WORKDIR /app +WORKDIR /app/webrtc-streamer + COPY --from=builder /app/ /app/ ENTRYPOINT [ "./webrtc-streamer" ] diff --git a/Dockerfile.rpi b/Dockerfile.rpi index 422dc031..4797cc51 100644 --- a/Dockerfile.rpi +++ b/Dockerfile.rpi @@ -7,31 +7,33 @@ LABEL maintainer=michel.promonet@free.fr ARG ARCH=armv6l ARG CROSSCOMPILER=https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2010.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-10.2.0-pi_0-1.tar.gz -WORKDIR /webrtc-streamer -COPY . /webrtc-streamer +WORKDIR /build/webrtc-streamer + +COPY . . + +ENV PATH /depot_tools:$PATH RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates build-essential gcc wget git python3 python3-pkg-resources xz-utils cmake make pkg-config \ - && mkdir /webrtc \ - && wget -qO- ${CROSSCOMPILER} | tar xz -C /webrtc \ - && export PATH=$(ls -d /webrtc/cross-pi-gcc-*/bin):$PATH \ + && wget -qO- ${CROSSCOMPILER} | tar xz -C /build \ + && export PATH=$(ls -d /build/cross-pi-gcc-*/bin):$PATH \ && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot_tools \ - && export PATH=/depot_tools:$PATH \ - && cd /webrtc \ + && mkdir ../webrtc \ + && cd ../webrtc \ && fetch --no-history --nohooks webrtc \ && sed -i -e "s|'src/resources'],|'src/resources'],'condition':'rtc_include_tests==true',|" src/DEPS \ && src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm \ && gclient sync \ - && cd /webrtc-streamer \ - && cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ - && cpack \ - && mkdir /app && tar xvzf webrtc-streamer*.tar.gz --strip=1 -C /app/ \ - && rm -rf /webrtc && rm -f *.a && rm -f src/*.o \ + && cd ../webrtc-streamer \ + && cmake -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_LIBRARY_ARCHITECTURE=arm-linux-gnueabihf -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY -DWEBRTCDESKTOPCAPTURE=OFF . && make \ + && make install \ + && rm -rf ../webrtc && rm -f *.a && rm -f src/*.o \ && apt-get clean && rm -rf /var/lib/apt/lists/ # run FROM $IMAGE -WORKDIR /app +WORKDIR /app/webrtc-streamer + COPY --from=builder /app/ /app/ ENTRYPOINT [ "./webrtc-streamer" ] diff --git a/Dockerfile.windows b/Dockerfile.windows index 227824f8..0da1bc3a 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -36,10 +36,10 @@ RUN git config --global core.autocrlf false \ && gclient sync \ && time /t \ && cd C:\webrtc-streamer \ - && cmake -G Ninja -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DCMAKE_MAKE_PROGRAM=ninja.bat . \ + && cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DCMAKE_MAKE_PROGRAM=ninja.bat . \ && time /t \ && ninja \ - && mkdir c:\app && copy webrtc-streamer.exe c:\app && copy config.json c:\app && xcopy /E html c:\app\html\ \ + && ninja install \ && del /f /s /q c:\webrtc > nul && rmdir /s /q c:\webrtc \ && time /t @@ -48,7 +48,8 @@ RUN powershell -c "sleep -Seconds 60" && time /t # run FROM mcr.microsoft.com/windows/server:ltsc2022 -WORKDIR /app +WORKDIR /app/webrtc-streamer + COPY --from=builder /app/ /app/ RUN dir /w && set