diff --git a/build.yaml b/build.yaml index 3f676a5cfa..464caf3288 100644 --- a/build.yaml +++ b/build.yaml @@ -13,5 +13,6 @@ packages: - centos.amd64 - linux.amd64 - windows.amd64 - - macos + - macos.amd64 + - macos.arm64 - portable diff --git a/deployment/Dockerfile.macos b/deployment/Dockerfile.macos.amd64 similarity index 90% rename from deployment/Dockerfile.macos rename to deployment/Dockerfile.macos.amd64 index f63dc29065..62f807687c 100644 --- a/deployment/Dockerfile.macos +++ b/deployment/Dockerfile.macos.amd64 @@ -17,7 +17,7 @@ RUN apt-get update -yqq \ libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 # Link to docker-build script -RUN ln -sf ${SOURCE_DIR}/deployment/build.macos /build.sh +RUN ln -sf ${SOURCE_DIR}/deployment/build.macos.amd64 /build.sh VOLUME ${SOURCE_DIR}/ diff --git a/deployment/Dockerfile.macos.arm64 b/deployment/Dockerfile.macos.arm64 new file mode 100644 index 0000000000..2dfbab9b33 --- /dev/null +++ b/deployment/Dockerfile.macos.arm64 @@ -0,0 +1,26 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim +# 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 ARCH=amd64 +ENV IS_DOCKER=YES + +# Prepare Debian build environment +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends \ + debhelper gnupg devscripts \ + mmv libcurl4-openssl-dev libfontconfig1-dev \ + libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 + +# Link to docker-build script +RUN ln -sf ${SOURCE_DIR}/deployment/build.macos.arm64 /build.sh + +VOLUME ${SOURCE_DIR}/ + +VOLUME ${ARTIFACT_DIR}/ + +ENTRYPOINT ["/build.sh"] diff --git a/deployment/build.macos b/deployment/build.macos.amd64 similarity index 96% rename from deployment/build.macos rename to deployment/build.macos.amd64 index 01c640c8bc..eac3538771 100755 --- a/deployment/build.macos +++ b/deployment/build.macos.amd64 @@ -1,6 +1,6 @@ #!/bin/bash -#= MacOS 10.13+ .tar.gz +#= macOS 10.13+ amd64 .tar.gz set -o errexit set -o xtrace diff --git a/deployment/build.macos.arm64 b/deployment/build.macos.arm64 new file mode 100755 index 0000000000..42da07e2f6 --- /dev/null +++ b/deployment/build.macos.arm64 @@ -0,0 +1,31 @@ +#!/bin/bash + +#= macOS 11.0+ arm64 .tar.gz + +set -o errexit +set -o xtrace + +# Move to source directory +pushd ${SOURCE_DIR} + +# Get version +if [[ ${IS_UNSTABLE} == 'yes' ]]; then + version="${BUILD_ID}" +else + version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )" +fi + +# Build archives +dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-arm64 --output dist/jellyfin-server_${version}/ -p:DebugSymbols=false -p:DebugType=none -p:UseAppHost=true +tar -czf jellyfin-server_${version}_macos-arm64.tar.gz -C dist jellyfin-server_${version} +rm -rf dist/jellyfin-server_${version} + +# Move the artifacts out +mkdir -p ${ARTIFACT_DIR}/ +mv jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/ + +if [[ ${IS_DOCKER} == YES ]]; then + chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} +fi + +popd