2020-07-10 09:07:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e -u
|
|
|
|
|
2020-12-16 10:56:42 +00:00
|
|
|
if [[ ! -z $(git status -s --untracked-files=no) ]]; then
|
|
|
|
echo "Git tree is not clean, aborting!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
if [[ "$BRANCH" != "master" ]]; then
|
|
|
|
echo "Not on master, aborting!";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2020-07-10 09:07:40 +00:00
|
|
|
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
|
|
|
|
|
|
|
pushd ${THIS_DIR}/..
|
2022-01-26 15:01:41 +00:00
|
|
|
CURRENT_LJM_DEP=$(jq -r '.dependencies."lib-jitsi-meet"' package.json)
|
2020-12-16 10:56:42 +00:00
|
|
|
popd
|
|
|
|
|
2022-01-26 15:01:41 +00:00
|
|
|
NEW_LJM_RELEASE=$(gh release list --limit 1 --repo jitsi/lib-jitsi-meet | awk {'print $1'})
|
|
|
|
GH_LINK="https://github.com/jitsi/lib-jitsi-meet/releases/tag/${NEW_LJM_RELEASE}"
|
|
|
|
LATEST_LJM_DEP="https://github.com/jitsi/lib-jitsi-meet/releases/download/${NEW_LJM_RELEASE}/lib-jitsi-meet.tgz"
|
2020-12-16 10:56:42 +00:00
|
|
|
|
2022-01-26 15:01:41 +00:00
|
|
|
if [[ "${CURRENT_LJM_DEP}" == "${LATEST_LJM_DEP}" ]]; then
|
2020-12-16 10:56:42 +00:00
|
|
|
echo "No need to update, already on the latest commit!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-02-10 18:38:01 +00:00
|
|
|
if [[ ${CURRENT_LJM_DEP} =~ ^.*download/(.*)/lib-jitsi-meet\.tgz$ ]]; then
|
|
|
|
COMMIT_MSG="https://github.com/jitsi/lib-jitsi-meet/compare/${BASH_REMATCH[1]}...${NEW_LJM_RELEASE}"
|
|
|
|
else
|
|
|
|
COMMIT_MSG=${GH_LINK}
|
|
|
|
fi
|
|
|
|
|
2020-12-16 10:56:42 +00:00
|
|
|
pushd ${THIS_DIR}/..
|
|
|
|
EPOCH=$(date +%s)
|
|
|
|
NEW_BRANCH="update-ljm-${EPOCH}"
|
|
|
|
git checkout -b ${NEW_BRANCH}
|
2022-01-26 15:01:41 +00:00
|
|
|
npm install ${LATEST_LJM_DEP}
|
2020-07-10 09:07:40 +00:00
|
|
|
git add package.json package-lock.json
|
2022-02-10 18:38:01 +00:00
|
|
|
git commit -m "chore(deps) lib-jitsi-meet@latest" -m "${COMMIT_MSG}"
|
2020-12-16 10:56:42 +00:00
|
|
|
git push origin ${NEW_BRANCH}
|
|
|
|
gh pr create --repo jitsi/jitsi-meet --fill
|
2020-07-10 09:07:40 +00:00
|
|
|
popd
|