Browse Source

Initial test of linux builds.

Ian Walton 3 years ago
parent
commit
30db19d53e
4 changed files with 88 additions and 2 deletions
  1. 34 2
      .github/workflows/main.yml
  2. 1 0
      .gitignore
  3. 27 0
      deployment/Dockerfile.debian
  4. 26 0
      deployment/build.debian

+ 34 - 2
.github/workflows/main.yml

@@ -47,7 +47,7 @@ jobs:
     - name: Archive production artifacts
       uses: actions/upload-artifact@v2
       with:
-        name: bundle.dmg
+        name: macos
         path: ${{ github.workspace }}/build/output/Jellyfin\ Media\ Player.dmg
   build-win:
     strategy:
@@ -94,5 +94,37 @@ jobs:
     - name: Archive production artifacts
       uses: actions/upload-artifact@v2
       with:
-        name: installer.exe
+        name: windows
         path: ${{ github.workspace }}/build/JellyfinMediaPlayer-*-windows-x64.exe
+  build-ubuntu:
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        tag: [bionic, focal, groovy]
+    runs-on: ${{ matrix.os }}
+    steps:
+    - name: Docker Build
+      run: |
+        docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} --build-arg IMG=ubuntu deployment
+        docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
+    - name: Archive production artifacts
+      uses: actions/upload-artifact@v2
+      with:
+        name: ubuntu-${{ matrix.tag }}
+        path: ${{ github.workspace }}/deployment/dist/*
+  build-debian:
+    strategy:
+      matrix:
+        os: [ubuntu-latest]
+        tag: [buster, bullseye]
+    runs-on: ${{ matrix.os }}
+    steps:
+    - name: Docker Build
+      run: |
+        docker build -f deployment/Dockerfile.debian -t builddeb --build-arg TAG=${{ matrix.tag }} deployment
+        docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e TAG=${{ matrix.tag }} builddeb
+    - name: Archive production artifacts
+      uses: actions/upload-artifact@v2
+      with:
+        name: debian-${{ matrix.tag }}
+        path: ${{ github.workspace }}/deployment/dist/*

+ 1 - 0
.gitignore

@@ -27,3 +27,4 @@ debian/files
 debian/jellyfin-media-player.substvars
 dist.zip
 obj-x86_64-linux-gnu/
+deployment/dist

+ 27 - 0
deployment/Dockerfile.debian

@@ -0,0 +1,27 @@
+ARG IMG=debian
+ARG TAG=buster
+FROM $IMG:$TAG
+
+# Docker build arguments
+ARG SOURCE_DIR=/jellyfin
+ARG ARTIFACT_DIR=/dist
+
+# Docker run environment
+ENV SOURCE_DIR=/jellyfin
+ENV ARTIFACT_DIR=/dist
+ENV DEB_BUILD_OPTIONS=noddebs
+ENV IS_DOCKER=YES
+
+# Prepare Debian build environment
+RUN apt-get update \
+  && apt-get install -y debhelper mmv git curl devscripts
+
+
+# Link to build script
+RUN ln -sf ${SOURCE_DIR}/deployment/build.debian /build.sh
+
+VOLUME ${SOURCE_DIR}
+
+VOLUME ${ARTIFACT_DIR}
+
+ENTRYPOINT ["/build.sh"]

+ 26 - 0
deployment/build.debian

@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -o errexit
+set -o xtrace
+
+# move to source directory
+pushd ${SOURCE_DIR}
+
+# install deps
+echo y | mk-build-deps -i
+
+# build deb
+dpkg-buildpackage -us -uc --pre-clean --post-clean
+
+mkdir -p ${ARTIFACT_DIR}
+for source_file in ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes}
+do
+    file=$(basename "$source_file")
+    mv "$source_file" "${ARTIFACT_DIR}/${file%.*}-${TAG}.${file##*.}"
+done
+
+if [[ ${IS_DOCKER} == YES ]]; then
+    chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
+fi
+
+popd