mirror of
https://github.com/jellyfin/jellyfin-build.git
synced 2024-11-27 08:00:44 +00:00
Add nuget autobuild scripts
This commit is contained in:
parent
2e3ab10bdc
commit
8b96e59248
@ -28,6 +28,9 @@ git submodule update --init
|
||||
|
||||
popd
|
||||
|
||||
# Build Nuget packages for release
|
||||
/bin/bash ${builddir}/scripts/build.d/build-jellyfin-nuget
|
||||
|
||||
# Build Docker containers for release
|
||||
/bin/bash ${builddir}/scripts/build.d/build-jellyfin-docker tag-name=${tagname} build-docker-manifests=yes
|
||||
|
||||
|
45
scripts/build.d/build-jellyfin-nuget
Normal file
45
scripts/build.d/build-jellyfin-nuget
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
builddir="/srv/jellyfin"
|
||||
reponame="jellyfin"
|
||||
repotype="server"
|
||||
|
||||
subprojects=( "Jellyfin.Common" "Jellyfin.Controller" "Jellyfin.Model" "Jellyfin.Naming" )
|
||||
subprojdirs=( "MediaBrowser.Common" "MediaBrowser.Controller" "MediaBrowser.Model" "Emby.Naming" )
|
||||
|
||||
nuget_api="https://api.nuget.org/v3/index.json"
|
||||
nuget_api_token="$( sudo cat /srv/jellyfin/secure/nuget_api_token )"
|
||||
owner='jellyfin'
|
||||
|
||||
#####
|
||||
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
|
||||
pushd ${builddir}/projects/${repotype}/${reponame}
|
||||
|
||||
tagname="$( hub release -L1 )"
|
||||
nice_tagname="$( sed 's/^v//g' <<<"${tagname}" )"
|
||||
|
||||
#####
|
||||
|
||||
for i in $( seq 0 $(( ${#subprojects[@]} - 1 )) ); do
|
||||
subproject="${subprojects[$i]}"
|
||||
dir="${subprojdirs[$i]}"
|
||||
pushd ${dir}
|
||||
# Pack the nupkg
|
||||
dotnet pack -c Release /p:Version=${nice_tagname}
|
||||
test -f bin/Release/${subproject}.${nice_tagname}.nupkg || continue
|
||||
# Push the nupkg
|
||||
set +o xtrace
|
||||
pushd bin/Release
|
||||
echo "+ dotnet nuget push ${subproject}.${nice_tagname}.nupkg -k xxx -s ${nuget_api}"
|
||||
dotnet nuget push bin/Release/${subproject}.${nice_tagname}.nupkg -k ${nuget_api_token} -s ${nuget_api}
|
||||
popd
|
||||
set -o xtrace
|
||||
# Clean up the nupkg artifacts
|
||||
dotnet clean || true
|
||||
popd
|
||||
done
|
||||
|
||||
popd
|
Loading…
Reference in New Issue
Block a user