| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | #!/bin/bash# Builds the ZIP archive inside the Docker containerset -o errexitset -o xtrace# Version variablesNSSM_VERSION="nssm-2.24-101-g897c7ad"NSSM_URL="http://files.evilt.win/nssm/${NSSM_VERSION}.zip"FFMPEG_VERSION="ffmpeg-4.2.1-win32-static"FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip"# Move to source directorypushd ${SOURCE_DIR}# Clone down and build Web frontendweb_build_dir="$( mktemp -d )"web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web"git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/pushd ${web_build_dir}if [[ -n ${web_branch} ]]; then    checkout -b origin/${web_branch}fiyarn installmkdir -p ${web_target}mv dist/* ${web_target}/popdrm -rf ${web_build_dir}# Get versionversion="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"# Build binarydotnet publish Jellyfin.Server --configuration Release --self-contained --runtime win-x86 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"# Prepare addinsaddin_build_dir="$( mktemp -d )"wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zipwget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zipunzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir}cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exeunzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir}cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.execp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exerm -rf ${addin_build_dir}# Prepare scriptscp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat# Create zip packagepushd /distzip -r /jellyfin_${version}.portable.zip jellyfin_${version}popdrm -rf /dist/jellyfin_${version}# Move the artifacts outmkdir -p ${ARTIFACT_DIR}/mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
 |