Skip to content

Commit

Permalink
feat: Build and Upload Debian Package
Browse files Browse the repository at this point in the history
  • Loading branch information
datagutt committed Nov 7, 2024
1 parent 1852d48 commit 73610b8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-deb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Upload Debian Package

on:
push:
branches:
- master
release:
types: [released]

jobs:
deb:
runs-on: warp-ubuntu-latest-arm64-4x
steps:
- uses: actions/checkout@v2
- run: sudo apt update && sudo apt install -y qemu-user-static binfmt-support
- uses: docker/build-push-action@v3
with:
context: .
outputs: build
- uses: paulhatch/semantic-version@v4
id: semantic
with:
tag_prefix: ""
format: ${{ github.event_name == 'release' && '${major}.${minor}.${patch}' || '${major}.${minor}.${patch}-prerelease${increment}' }}
- uses: jiro4989/build-deb-action@v2
id: build
with:
package: irl-libsrt
package_root: ./build
maintainer: IRL Software <[email protected]>
version: ${{ steps.semantic.outputs.version }}
depends: "openssl, libssl-dev"
arch: "arm64"
- uses: actions/upload-artifact@v3
with:
name: libsrt-arm64.deb
path: ${{ steps.build.outputs.file_name }}
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ else()
project(SRT VERSION ${SRT_VERSION} LANGUAGES C CXX)
endif()


set(CPACK_PACKAGE_NAME "irl-libsrt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_PACKAGE_ARCHITECTURE "arm64")
set(CPACK_PACKAGE_VERSION ${SRT_VERSION})
set(CPACK_PACKAGE_CONTACT "IRL Software <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)

include(CPack)

if (NOT ${CMAKE_VERSION} VERSION_LESS "3.28.1")
cmake_policy(SET CMP0054 NEW)
endif ()
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM --platform=linux/arm64 ubuntu:latest AS build

ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install cmake make wget xz-utils git build-essential libssl-dev openssl -y

WORKDIR /libsrt
COPY . .

RUN mkdir /out
RUN cmake -DCMAKE_INSTALL_PREFIX=/usr ./
RUN make -j
RUN make DESTDIR=/out install

FROM scratch AS export
COPY --from=build /out /

0 comments on commit 73610b8

Please sign in to comment.