diff --git a/.github/workflows/publish-deb.yaml b/.github/workflows/publish-deb.yaml new file mode 100644 index 000000000..729cde4e4 --- /dev/null +++ b/.github/workflows/publish-deb.yaml @@ -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 + 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 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ed11ef8e..d6e1bada3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ") +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 () diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c757081c5 --- /dev/null +++ b/Dockerfile @@ -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 /