编译到固件出错
git clone https://github.com/stackia/rtp2httpd.git package/rtp2httpd
echo "CONFIG_PACKAGE_luci-app-rtp2httpd=y" >> .config echo "CONFIG_PACKAGE_rtp2httpd=y" >> .config
make[4]: Entering directory '/home/test/openwrt/build_dir/target-aarch64_cortex-a53_musl/rtp2httpd-1.0.0' make[4]: *** No targets specified and no makefile found. Stop. make[4]: Leaving directory '/home/test/openwrt/build_dir/target-aarch64_cortex-a53_musl/rtp2httpd-1.0.0' make[3]: *** [Makefile:47: /home/test/openwrt/build_dir/target-aarch64_cortex-a53_musl/rtp2httpd-1.0.0/.built] Error 2 make[3]: Leaving directory '/home/test/openwrt/package/rtp2httpd/openwrt-support/rtp2httpd' time: package/rtp2httpd/openwrt-support/rtp2httpd/compile#0.05#0.02#0.07 ERROR: package/rtp2httpd/openwrt-support/rtp2httpd failed to build. make[2]: *** [package/Makefile:120: package/rtp2httpd/openwrt-support/rtp2httpd/compile] Error 1 make[2]: Leaving directory '/home/test/openwrt' make[1]: *** [package/Makefile:114: /home/test/openwrt/staging_dir/target-aarch64_cortex-a53_musl/stamp/.package_compile] Error 2 make[1]: Leaving directory '/home/test/openwrt' make: *** [/home/test/openwrt/include/toplevel.mk:230:world] 错误 2
本地构建 openwrt package 需要手动做这一步 https://github.com/stackia/rtp2httpd/blob/main/.github/workflows/release.yaml#L231
本地构建 openwrt package 需要手动做这一步 https://github.com/stackia/rtp2httpd/blob/main/.github/workflows/release.yaml#L231
加了能编译了,版本号是1.0.0,能否同步?
你可以考虑像他一样自己维护一个 Makefile,用 github action 同步版本号
https://github.com/smdx/rtp2httpd
https://github.com/stackia/rtp2httpd/blob/main/docs/installation.md#openwrt-%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85
现在已支持直接使用本仓库的 openwrt Makefile。版本号会自动读 git tag 来设置。
本地构建 openwrt package 需要手动做这一步 https://github.com/stackia/rtp2httpd/blob/main/.github/workflows/release.yaml#L231
[请问这个具体怎么操作?是执行一下run后面的参数吗? 因为我这边用https://github.com/stackia/rtp2httpd/blob/main/docs/installation.md#openwrt-%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85时,编译时始终没有找到 LuCI -> Applications -> luci-app-rtp2httpd,本地编译的版本是openwrt-23.05 谢谢!
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
fail-fast: false
matrix:
arch:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- armv7-unknown-linux-musleabihf
- armv7-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- arm-unknown-linux-musleabi
- mipsel-unknown-linux-musl
- mips-unknown-linux-musl
- mips64-unknown-linux-musl
- riscv64-unknown-linux-musl
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
pkg-config \
wget \
xz-utils
- name: Set version environment variable
run: |
RELEASE_TAG="${{ github.event.release.tag_name }}"
echo "RELEASE_VERSION=${RELEASE_TAG#v}" >> $GITHUB_ENV
- name: Generate configure script
run: autoreconf -fi
- name: Build static binary
env:
TOOLCHAIN_PREFIX: ${{ matrix.arch }}
run: ./scripts/build-static.sh
- name: Prepare release artifact
id: prepare
run: |
ARCH="${{ matrix.arch }}"
if [[ "$ARCH" == arm* ]]; then
BASE_ARCH="${ARCH%%-*}"
if [[ "$ARCH" == *"eabihf"* ]]; then
ARCH_SHORT="${BASE_ARCH}-eabihf"
elif [[ "$ARCH" == *"eabi"* ]]; then
ARCH_SHORT="${BASE_ARCH}-eabi"
else
ARCH_SHORT="$BASE_ARCH"
fi
else
ARCH_SHORT="${ARCH%%-*}"
fi
BINARY_PATH="build-${ARCH}-static/dist/usr/bin/rtp2httpd"
if [ ! -f "$BINARY_PATH" ]; then
echo "Error: Binary not found at $BINARY_PATH"
exit 1
fi
OUTPUT_NAME="rtp2httpd-${RELEASE_VERSION}-${ARCH_SHORT}"
cp "$BINARY_PATH" "$OUTPUT_NAME"
file "$OUTPUT_NAME"
ls -lh "$OUTPUT_NAME"
echo "binary_name=$OUTPUT_NAME" >> $GITHUB_OUTPUT
- name: Upload to release assets
run: |
gh release upload \
--repo ${{ github.repository }} \
${{ github.event.release.tag_name }} \
${{ steps.prepare.outputs.binary_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}````