From a542900a5e04fd17e21f2e6e5af931d7587d9494 Mon Sep 17 00:00:00 2001 From: giangndm <45644921+giangndm@users.noreply.github.com> Date: Fri, 12 Jul 2024 03:37:59 +0000 Subject: [PATCH] added build record tool --- .github/workflows/release.yml | 25 ++++++++++++++++++++++--- packages/media_record/Cargo.toml | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a76b3dd..98f3e051 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,7 @@ concurrency: env: APP_NAME: atm0s-media-server + RECORD_TOOL: atm0s-media-record ARTIFACT_DIR: release-builds REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -90,6 +91,7 @@ jobs: target: x86_64-unknown-linux-gnu extension: "" cross: false + build_record_tool: true - build: linux musl x64 os: ubuntu-latest rust: stable @@ -102,6 +104,7 @@ jobs: target: aarch64-unknown-linux-gnu extension: "" cross: true + build_record_tool: true - build: linux musl aarch64 os: ubuntu-latest rust: stable @@ -156,12 +159,14 @@ jobs: target: x86_64-apple-darwin extension: "" cross: false + build_record_tool: true - build: macos aarch64 os: macos-latest rust: stable target: aarch64-apple-darwin extension: "" cross: true + build_record_tool: true # - build: windows gnu x64 # os: ubuntu-latest # rust: stable @@ -201,16 +206,30 @@ jobs: run: | mv ./.cargo/config.toml.release-build .cargo/config.toml - - name: Build + - name: Build server uses: actions-rs/cargo@v1 with: use-cross: ${{ matrix.cross }} command: build args: --verbose --release --package ${{ env.APP_NAME }} --target ${{ matrix.target }} --features embed_static - - name: Rename file + - name: Build record tool + if: matrix.build_record_tool + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.cross }} + command: build + args: --verbose --release --package ${{ env.RECORD_CONVERT }} --target ${{ matrix.target }} --bin convert_webm + + - name: Rename server if: ${{ matrix.build != 'windows gnu x64' && matrix.build != 'windows msvc x64' }} - run: mv ./target/${{ matrix.target }}/release/${{ env.APP_NAME }}${{ matrix.extension }} ${{ env.APP_NAME }}-${{ matrix.target }}${{ matrix.extension }} + run: | + mv ./target/${{ matrix.target }}/release/${{ env.APP_NAME }}${{ matrix.extension }} ${{ env.APP_NAME }}-${{ matrix.target }}${{ matrix.extension }} + + - name: Rename record + if: matrix.build_record_tool && ${{ matrix.build != 'windows gnu x64' && matrix.build != 'windows msvc x64' }} + run: | + mv ./target/${{ matrix.target }}/release/convert_webm${{ matrix.extension }} convert_webm-${{ matrix.target }}${{ matrix.extension }} - name: Upload Artifact to Summary if: ${{ matrix.build != 'windows gnu x64' && matrix.build != 'windows msvc x64' }} diff --git a/packages/media_record/Cargo.toml b/packages/media_record/Cargo.toml index d8ed4a4d..a9dccc0f 100644 --- a/packages/media_record/Cargo.toml +++ b/packages/media_record/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1.0", features = ["derive"], optional = true } [features] default = ["convert_webm"] -convert_webm = ["tokio/full", "tracing-subscriber", "rtp", "clap", "serde"] +convert_webm = ["tokio/full", "tracing-subscriber", "webm", "rtp", "clap", "serde"] [dev-dependencies] tokio = { version = "1", features = ["full"] }