Files
subtitle-compagnion/scripts/package.sh
T

23 lines
875 B
Bash

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
npm ci --ignore-scripts
npm run build
docker run --rm --user "$(id -u):$(id -g)" \
-e DOTNET_CLI_HOME=/tmp/dotnet -e NUGET_PACKAGES=/tmp/nuget \
-v "$PWD:/work" -w /work \
mcr.microsoft.com/dotnet/sdk:10.0@sha256:2fa828c68761b1b8c23d7662dc134421b9d3b59fe1425fdbc80804e390cdb24d \
dotnet build src/Compagnon -c Release
python3 - <<'PY'
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
import hashlib
archive = Path('dist/compagnon-1.0.6-jellyfin-12.1.0.zip')
archive.parent.mkdir(exist_ok=True)
with ZipFile(archive, 'w', ZIP_DEFLATED) as package:
package.write('src/Compagnon/bin/Release/net10.0/Compagnon.dll', 'Compagnon/Compagnon.dll')
archive.with_suffix('.zip.sha256').write_text(hashlib.sha256(archive.read_bytes()).hexdigest() + ' ' + archive.name + '\n')
print(archive)
PY