fix: 完善ustreamer编译缓存解决方案

- 在编译完成后将目录重命名为标准路径 /tmp/ustreamer
- 确保后续构建步骤能正确引用 ustreamer 二进制文件
- 保持缓存破坏机制的同时维护构建流程的兼容性
This commit is contained in:
mofeng-git 2025-08-23 10:05:00 +08:00
parent 16878dc7ff
commit 0b4d83dc93
2 changed files with 7 additions and 13 deletions

View File

@ -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

View File

@ -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 \