2020-03-23 21:06:35 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o xtrace
|
|
|
|
|
2020-06-12 08:18:20 -07:00
|
|
|
# move to source directory
|
2020-03-23 21:06:35 -07:00
|
|
|
pushd ${SOURCE_DIR}
|
|
|
|
|
2021-03-01 16:28:44 -07:00
|
|
|
cp -a package-lock.json /tmp/package-lock.json
|
2020-03-23 21:06:35 -07:00
|
|
|
|
2020-06-12 11:22:08 -07:00
|
|
|
# modify changelog to unstable configuration if IS_UNSTABLE
|
2020-06-12 14:20:01 -07:00
|
|
|
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
|
2020-06-15 03:54:00 -07:00
|
|
|
pushd debian
|
|
|
|
|
2020-06-12 11:22:08 -07:00
|
|
|
PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
|
2020-06-15 03:54:00 -07:00
|
|
|
|
2020-06-12 11:22:08 -07:00
|
|
|
cat <<EOF >changelog
|
|
|
|
jellyfin-web (${BUILD_ID}-unstable) unstable; urgency=medium
|
|
|
|
|
2020-06-12 13:12:30 -07:00
|
|
|
* Jellyfin Web unstable build ${BUILD_ID} for merged PR #${PR_ID}
|
2020-06-12 11:22:08 -07:00
|
|
|
|
|
|
|
-- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
|
|
|
|
EOF
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2020-06-12 08:18:20 -07:00
|
|
|
# build deb
|
2020-03-23 21:06:35 -07:00
|
|
|
dpkg-buildpackage -us -uc --pre-clean --post-clean
|
|
|
|
|
2020-06-12 08:18:20 -07:00
|
|
|
mkdir -p ${ARTIFACT_DIR}
|
|
|
|
mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}
|
2020-03-23 21:06:35 -07:00
|
|
|
|
2021-03-01 16:28:44 -07:00
|
|
|
cp -a /tmp/package-lock.json package-lock.json
|
2020-03-23 21:06:35 -07:00
|
|
|
|
|
|
|
if [[ ${IS_DOCKER} == YES ]]; then
|
2020-06-15 03:54:00 -07:00
|
|
|
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
|
2020-03-23 21:06:35 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
popd
|