diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e80621..e0345d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - { target: aarch64-pc-windows-msvc , os: windows-2022 } - { target: aarch64-linux-android , os: ubuntu-22.04, use-cross: true } - { target: aarch64-unknown-linux-gnu , os: ubuntu-22.04, use-cross: true } - - { target: aarch64-unknown-linux-musl , os: ubuntu-22.04, use-cross: true } + - { target: aarch64-unknown-linux-musl , os: ubuntu-22.04, use-cross: true, nfpm: arm64 } - { target: arm-unknown-linux-gnueabihf , os: ubuntu-22.04, use-cross: true } - { target: arm-unknown-linux-musleabihf, os: ubuntu-22.04, use-cross: true } - { target: i686-pc-windows-msvc , os: windows-2022 } @@ -31,7 +31,7 @@ jobs: - { target: x86_64-pc-windows-gnu , os: windows-2022 } - { target: x86_64-pc-windows-msvc , os: windows-2022 } - { target: x86_64-unknown-linux-gnu , os: ubuntu-22.04, use-cross: true } - - { target: x86_64-unknown-linux-musl , os: ubuntu-22.04, use-cross: true } + - { target: x86_64-unknown-linux-musl , os: ubuntu-22.04, use-cross: true, nfpm: amd64 } env: VERSION: $GITHUB_REF_NAME BUILD_CMD: cargo @@ -147,6 +147,38 @@ jobs: # Let subsequent steps know where to find the compressed package echo "TAR_LIVEMAN_NAME=${TAR_NAME}" >> $GITHUB_ENV + - name: Install nFPM + if: ${{ matrix.job.nfpm }} + run: | + echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list + sudo apt update + sudo apt install nfpm + + - name: Set nFPM environment + if: ${{ matrix.job.nfpm }} + run: | + echo "ARCH=${{ matrix.job.nfpm }}" >> $GITHUB_ENV + echo "TARGET=${{ matrix.job.target }}" >> $GITHUB_ENV + echo "VERSION=git describe --tags" >> $GITHUB_ENV + + - name: Build nFPM config + if: ${{ matrix.job.nfpm }} + run: | + envsubst < nfpm/live777.yaml > live777.yaml + envsubst < nfpm/liveman.yaml > liveman.yaml + envsubst < nfpm/net4mqtt.yaml > net4mqtt.yaml + envsubst < nfpm/whipinto.yaml > whipinto.yaml + envsubst < nfpm/whepfrom.yaml > whepfrom.yaml + + - name: Use nFPM + if: ${{ matrix.job.nfpm }} + run: | + nfpm pkg --packager deb --config live777.yaml + nfpm pkg --packager deb --config liveman.yaml + nfpm pkg --packager deb --config net4mqtt.yaml + nfpm pkg --packager deb --config whipinto.yaml + nfpm pkg --packager deb --config whepfrom.yaml + - name: Artifact Upload Live777 uses: actions/upload-artifact@v4 with: diff --git a/Cargo.toml b/Cargo.toml index 2fa60f9..de0441b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,48 +96,3 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } webui = ["liveion/webui", "liveman/webui"] net4mqtt = ["liveion/net4mqtt", "liveman/net4mqtt"] -# cargo install cargo-deb -# Reference: https://github.com/kornelski/cargo-deb -[package.metadata.deb] -maintainer = "Metal A-Wing <1@233.email>" -copyright = "BinBat LTD " -license-file = ["LICENSE"] -extended-description = """\ -A very simple, high performance, edge WebRTC SFU.\ -Real-time video streaming for the `WHIP`/`WHEP` as first protocol.\ -""" -depends = "libc6 systemd" -section = "utility" -priority = "optional" -assets = [ - [ - "target/release/live777", - "usr/bin/", - "755", - ], - [ - "target/release/whipinto", - "usr/bin/", - "755", - ], - [ - "target/release/whepfrom", - "usr/bin/", - "755", - ], - [ - "config-dist.toml", - "etc/live777/config.toml", - "644", - ], - [ - "live777.service", - "usr/lib/systemd/system/live777.service", - "644", - ], - [ - "README.md", - "usr/share/doc/live777/README", - "644", - ], -] diff --git a/nfpm/live777.yaml b/nfpm/live777.yaml new file mode 100644 index 0000000..c62d994 --- /dev/null +++ b/nfpm/live777.yaml @@ -0,0 +1,22 @@ +name: "live777" +arch: "${ARCH}" +platform: "linux" +version: "${VERSION}" +section: "utility" +priority: "optional" +maintainer: "Max A-wing <1@233.email>" +description: | + A very simple, high performance, edge WebRTC SFU. + Real-time video streaming for the `WHIP`/`WHEP` as first protocol. +vendor: "BinBat" +homepage: "http://live777.binbat.com" +license: "MPL-2.0" +contents: + - src: ./target/${TARGET}/release/live777 + dst: /usr/bin/live777 + - src: ./conf/live777.service + dst: /usr/lib/systemd/system/live777.service + - src: ./conf/live777.toml + dst: /etc/live777/live777.toml + type: config + diff --git a/nfpm/liveman.yaml b/nfpm/liveman.yaml new file mode 100644 index 0000000..9b79de4 --- /dev/null +++ b/nfpm/liveman.yaml @@ -0,0 +1,22 @@ +name: "liveman" +arch: "${ARCH}" +platform: "linux" +version: "${VERSION}" +section: "utility" +priority: "optional" +maintainer: "Max A-wing <1@233.email>" +description: | + A very simple, high performance, edge WebRTC SFU. + Live777 cluster manager controller +vendor: "BinBat" +homepage: "http://live777.binbat.com" +license: "MPL-2.0" +contents: + - src: ./target/${TARGET}/release/liveman + dst: /usr/bin/liveman + - src: ./conf/liveman.service + dst: /usr/lib/systemd/system/liveman.service + - src: ./conf/liveman.toml + dst: /etc/live777/liveman.toml + type: config + diff --git a/nfpm/net4mqtt.yaml b/nfpm/net4mqtt.yaml new file mode 100644 index 0000000..f24cec2 --- /dev/null +++ b/nfpm/net4mqtt.yaml @@ -0,0 +1,17 @@ +name: "net4mqtt" +arch: "${ARCH}" +platform: "linux" +version: "${VERSION}" +section: "utility" +priority: "optional" +maintainer: "Max A-wing <1@233.email>" +description: | + A very simple, high performance, edge WebRTC SFU. + RTP/RTSP to WHIP tool +vendor: "BinBat" +homepage: "http://live777.binbat.com" +license: "MPL-2.0" +contents: + - src: ./target/${TARGET}/release/net4mqtt + dst: /usr/bin/net4mqtt + diff --git a/nfpm/whepfrom.yaml b/nfpm/whepfrom.yaml new file mode 100644 index 0000000..cfbc10a --- /dev/null +++ b/nfpm/whepfrom.yaml @@ -0,0 +1,17 @@ +name: "whepfrom" +arch: "${ARCH}" +platform: "linux" +version: "${VERSION}" +section: "utility" +priority: "optional" +maintainer: "Max A-wing <1@233.email>" +description: | + A very simple, high performance, edge WebRTC SFU. + WHEP to RTP/RTSP tool +vendor: "BinBat" +homepage: "http://live777.binbat.com" +license: "MPL-2.0" +contents: + - src: ./target/${TARGET}/release/whepfrom + dst: /usr/bin/whepfrom + diff --git a/nfpm/whipinto.yaml b/nfpm/whipinto.yaml new file mode 100644 index 0000000..179eb16 --- /dev/null +++ b/nfpm/whipinto.yaml @@ -0,0 +1,17 @@ +name: "whipinto" +arch: "${ARCH}" +platform: "linux" +version: "${VERSION}" +section: "utility" +priority: "optional" +maintainer: "Max A-wing <1@233.email>" +description: | + A very simple, high performance, edge WebRTC SFU. + RTP/RTSP to WHIP tool +vendor: "BinBat" +homepage: "http://live777.binbat.com" +license: "MPL-2.0" +contents: + - src: ./target/${TARGET}/release/whipinto + dst: /usr/bin/whipinto +