From 0b4d83dc93e9d52a1069aed6561c8688da07ff21 Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Sat, 23 Aug 2025 10:05:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84ustreamer=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E7=BC=93=E5=AD=98=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在编译完成后将目录重命名为标准路径 /tmp/ustreamer - 确保后续构建步骤能正确引用 ustreamer 二进制文件 - 保持缓存破坏机制的同时维护构建流程的兼容性 --- .github/workflows/docker-build.yaml | 7 ------- build/Dockerfile-stage-0 | 13 +++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 7107a403..717b537d 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -103,8 +103,6 @@ jobs: provenance: false sbom: false allow: security.insecure - build-args: | - CACHEBUST=$(date +%s) build-main: runs-on: ubuntu-22.04 @@ -150,10 +148,8 @@ jobs: run: | if [[ "${{ github.event.inputs.build_type }}" == "dev" ]]; then echo "tag=dev" >> $GITHUB_OUTPUT - echo "cachebust=$(date +%s)" >> $GITHUB_OUTPUT elif [[ "${{ github.event.inputs.build_type }}" == "release" ]]; then echo "tag=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT - echo "cachebust=$(date +%s)" >> $GITHUB_OUTPUT fi - name: Extract metadata @@ -186,8 +182,6 @@ jobs: cache-to: type=gha,mode=max,scope=main provenance: false sbom: false - build-args: | - CACHEBUST=${{ steps.version.outputs.cachebust }} - name: Build summary run: | @@ -196,6 +190,5 @@ jobs: echo "- **Version Tag**: ${{ steps.version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY echo "- **Platforms**: ${{ github.event.inputs.platforms }}" >> $GITHUB_STEP_SUMMARY echo "- **Aliyun Enabled**: ${{ github.event.inputs.enable_aliyun }}" >> $GITHUB_STEP_SUMMARY - echo "- **Cache Bust**: ${{ steps.version.outputs.cachebust }}" >> $GITHUB_STEP_SUMMARY echo "- **Tags**:" >> $GITHUB_STEP_SUMMARY echo "${{ steps.meta.outputs.tags }}" | sed 's/^/ - /' >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/build/Dockerfile-stage-0 b/build/Dockerfile-stage-0 index 11911ae9..278e5712 100644 --- a/build/Dockerfile-stage-0 +++ b/build/Dockerfile-stage-0 @@ -132,13 +132,14 @@ RUN git clone --depth=1 https://gitlab.freedesktop.org/libnice/libnice /tmp/libn && rm -rf /tmp/janus-gateway # 编译 ustreamer -ARG CACHEBUST=1 -RUN echo "Cache bust: $CACHEBUST" \ +RUN echo "Building ustreamer with timestamp cache bust" \ && sed --in-place --expression 's|^#include "refcount.h"$|#include "../refcount.h"|g' /usr/include/janus/plugins/plugin.h \ - && git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer \ - && make -j WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer \ - && /tmp/ustreamer/ustreamer -v \ - && cp /tmp/ustreamer/python/dist/*.whl /tmp/wheel/ + && TIMESTAMP=$(date +%s%N) \ + && git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer-${TIMESTAMP} \ + && make -j WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \ + && /tmp/ustreamer-${TIMESTAMP}/ustreamer -v \ + && cp /tmp/ustreamer-${TIMESTAMP}/python/dist/*.whl /tmp/wheel/ \ + && mv /tmp/ustreamer-${TIMESTAMP} /tmp/ustreamer # 复制必要的库文件 RUN mkdir /tmp/lib \