Add support for Debug releases
Allows specifying --debug to build.py to build Debug builds of the server, facilitating easier debugging. This is then called by default for weekly builds.
This commit is contained in:
22
.github/workflows/release-build.yaml
vendored
22
.github/workflows/release-build.yaml
vendored
@@ -29,6 +29,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -50,7 +51,7 @@ jobs:
|
||||
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
|
||||
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} docker
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} docker ${{ env.DEBUG_FLAG }}
|
||||
|
||||
Debian:
|
||||
runs-on: ubuntu-24.04
|
||||
@@ -75,6 +76,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -91,7 +93,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} debian ${{ matrix.arch }} ${{ matrix.release }}
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} debian ${{ matrix.arch }} ${{ matrix.release }} ${{ env.DEBUG_FLAG }}
|
||||
sudo chown --recursive $USER out/debian
|
||||
|
||||
- name: "Import repository signing GPG key"
|
||||
@@ -220,6 +222,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -236,7 +239,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} ubuntu ${{ matrix.arch }} ${{ matrix.release }}
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} ubuntu ${{ matrix.arch }} ${{ matrix.release }} ${{ env.DEBUG_FLAG }}
|
||||
sudo chown --recursive $USER out/ubuntu
|
||||
|
||||
- name: "Import repository signing GPG key"
|
||||
@@ -363,6 +366,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -379,7 +383,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for ${{ matrix.arch }}"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} linux ${{ matrix.arch }}
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} linux ${{ matrix.arch }} ${{ env.DEBUG_FLAG }}
|
||||
|
||||
- name: "Upload artifacts to repository server"
|
||||
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
|
||||
@@ -436,6 +440,7 @@ jobs:
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_OUTPUT
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_OUTPUT
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -452,7 +457,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for ${{ matrix.arch }}"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} windows ${{ matrix.arch }}
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} windows ${{ matrix.arch }} ${{ env.DEBUG_FLAG }}
|
||||
|
||||
- name: "Upload artifacts to repository server"
|
||||
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
|
||||
@@ -643,6 +648,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -659,7 +665,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} macos ${{ matrix.arch }}
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} macos ${{ matrix.arch }} ${{ env.DEBUG_FLAG }}
|
||||
|
||||
- name: "Upload artifacts to repository server"
|
||||
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
|
||||
@@ -703,6 +709,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
@@ -719,7 +726,7 @@ jobs:
|
||||
|
||||
- name: "Run builder for Portable"
|
||||
run: |-
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} portable
|
||||
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} portable ${{ env.DEBUG_FLAG }}
|
||||
|
||||
- name: "Upload artifacts to repository server"
|
||||
uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
|
||||
@@ -762,6 +769,7 @@ jobs:
|
||||
else
|
||||
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
|
||||
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
|
||||
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Install dependencies"
|
||||
|
||||
37
build.py
37
build.py
@@ -82,7 +82,7 @@ def _determine_framework_versions():
|
||||
|
||||
|
||||
def build_package_deb(
|
||||
jellyfin_version, build_type, build_arch, build_version, local=False
|
||||
jellyfin_version, build_type, build_arch, build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build a .deb package (Debian or Ubuntu) within a Docker container that matches the requested distribution version
|
||||
@@ -168,15 +168,15 @@ def build_package_deb(
|
||||
)
|
||||
|
||||
log(
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --name {imagename} {imagename}"
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
os.system(
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --name {imagename} {imagename}"
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
|
||||
|
||||
def build_linux(
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build a portable Linux archive
|
||||
@@ -224,15 +224,15 @@ def build_linux(
|
||||
)
|
||||
|
||||
log(
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=linux --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=linux --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
os.system(
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=linux --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=linux --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
|
||||
|
||||
def build_windows(
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build a portable Windows archive
|
||||
@@ -280,15 +280,15 @@ def build_windows(
|
||||
)
|
||||
|
||||
log(
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=win --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=win --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
os.system(
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=win --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=win --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
|
||||
|
||||
def build_macos(
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build a portable MacOS archive
|
||||
@@ -336,15 +336,15 @@ def build_macos(
|
||||
)
|
||||
|
||||
log(
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=osx --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=osx --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
os.system(
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=osx --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env PACKAGE_ARCH={PACKAGE_ARCH} --env DOTNET_TYPE=osx --env DOTNET_ARCH={DOTNET_ARCH} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
|
||||
|
||||
def build_portable(
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build a portable .NET archive
|
||||
@@ -387,15 +387,15 @@ def build_portable(
|
||||
)
|
||||
|
||||
log(
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f">>> {docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
os.system(
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env ARCHIVE_TYPES={archivetypes} --name {imagename} {imagename}"
|
||||
f"{docker_run_cmd} --volume {repo_root_dir}:/jellyfin --volume {repo_root_dir}/out/{build_type}:/dist --env JELLYFIN_VERSION={jellyfin_version} --env BUILD_TYPE={build_type} --env ARCHIVE_TYPES={archivetypes} --env CONFIG={'Debug' if debug else 'Release'} --name {imagename} {imagename}"
|
||||
)
|
||||
|
||||
|
||||
def build_docker(
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Build Docker images for one or all architectures and combining manifests
|
||||
@@ -618,7 +618,7 @@ def build_docker(
|
||||
|
||||
|
||||
def build_nuget(
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False
|
||||
jellyfin_version, build_type, _build_arch, _build_version, local=False, debug=False
|
||||
):
|
||||
"""
|
||||
Pack and upload nuget packages
|
||||
@@ -716,6 +716,7 @@ parser.add_argument('build_type', choices=configurations.keys(), help='The build
|
||||
parser.add_argument('build_arch', default=None, nargs='?', help='The build architecture')
|
||||
parser.add_argument('build_version', default=None, nargs='?', help='The build release version [debian/ubuntu only]')
|
||||
parser.add_argument('--local', action='store_true', help='Local build, do not generate manifests or push them [docker only]')
|
||||
parser.add_argument('--debug', action='store_true', help='Debug build, set .NET to use Debug instead of Release')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -735,5 +736,5 @@ if jellyfin_version in ["auto", "master"]:
|
||||
|
||||
# Launch the builder function
|
||||
function_definitions[configurations[build_type]["build_function"]](
|
||||
jellyfin_version, build_type, build_arch, build_version, local=args.local
|
||||
jellyfin_version, build_type, build_arch, build_version, local=args.local, debug=args.debug
|
||||
)
|
||||
|
||||
2
debian/rules
vendored
2
debian/rules
vendored
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/make -f
|
||||
CONFIG := Release
|
||||
CONFIG ?= Release
|
||||
TERM := xterm
|
||||
SHELL := /bin/bash
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ ARG ARTIFACT_DIR=/web
|
||||
|
||||
ARG JELLYFIN_VERSION
|
||||
ENV JELLYFIN_VERSION=${JELLYFIN_VERSION}
|
||||
ENV CONFIG=Release
|
||||
|
||||
RUN apk add \
|
||||
autoconf \
|
||||
@@ -85,7 +86,7 @@ WORKDIR ${SOURCE_DIR}
|
||||
COPY jellyfin-server .
|
||||
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
|
||||
RUN dotnet publish Jellyfin.Server --arch ${DOTNET_ARCH} \
|
||||
RUN dotnet publish Jellyfin.Server --arch ${DOTNET_ARCH} --configuration ${CONFIG} \
|
||||
--output="${ARTIFACT_DIR}" --self-contained \
|
||||
-p:DebugSymbols=false -p:DebugType=none
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ case ${BUILD_TYPE} in
|
||||
;;
|
||||
esac
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
dotnet publish Jellyfin.Server --configuration Release ${RUNTIME} --output ${BUILD_DIR}/jellyfin/ -p:DebugSymbols=false -p:DebugType=none ${APPHOST}
|
||||
if [[ -z ${CONFIG} ]]; then
|
||||
CONFIG="Release"
|
||||
fi
|
||||
dotnet publish Jellyfin.Server --configuration ${CONFIG} ${RUNTIME} --output ${BUILD_DIR}/jellyfin/ -p:DebugSymbols=false -p:DebugType=none ${APPHOST}
|
||||
popd
|
||||
|
||||
# Build web
|
||||
|
||||
Reference in New Issue
Block a user