Skip to content

Commit

Permalink
add nfpm build package deb
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 10, 2024
1 parent db2184b commit caf73e4
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 47 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
45 changes: 0 additions & 45 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
copyright = "BinBat LTD <[email protected]>"
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",
],
]
22 changes: 22 additions & 0 deletions nfpm/live777.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "live777"
arch: "${ARCH}"
platform: "linux"
version: "${VERSION}"
section: "utility"
priority: "optional"
maintainer: "Max A-wing <[email protected]>"
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

22 changes: 22 additions & 0 deletions nfpm/liveman.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "liveman"
arch: "${ARCH}"
platform: "linux"
version: "${VERSION}"
section: "utility"
priority: "optional"
maintainer: "Max A-wing <[email protected]>"
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

17 changes: 17 additions & 0 deletions nfpm/net4mqtt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "net4mqtt"
arch: "${ARCH}"
platform: "linux"
version: "${VERSION}"
section: "utility"
priority: "optional"
maintainer: "Max A-wing <[email protected]>"
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

17 changes: 17 additions & 0 deletions nfpm/whepfrom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "whepfrom"
arch: "${ARCH}"
platform: "linux"
version: "${VERSION}"
section: "utility"
priority: "optional"
maintainer: "Max A-wing <[email protected]>"
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

17 changes: 17 additions & 0 deletions nfpm/whipinto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "whipinto"
arch: "${ARCH}"
platform: "linux"
version: "${VERSION}"
section: "utility"
priority: "optional"
maintainer: "Max A-wing <[email protected]>"
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

0 comments on commit caf73e4

Please sign in to comment.