From 01910d32313f31de52b8491715bfb15d5d15e89e Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 15 Oct 2022 21:09:27 +0200 Subject: [PATCH] flathub release script --- bin/release-flatpack.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/release-flatpack.sh b/bin/release-flatpack.sh index f9fcf43f0..f28ff7adb 100755 --- a/bin/release-flatpack.sh +++ b/bin/release-flatpack.sh @@ -17,21 +17,27 @@ VERSION_DATE=$(git log -1 --format=%aI "v${VERSION}" | cut -c -10) VERSION_COMMIT=$(git rev-list -n 1 "v${VERSION}") # expecting the directory at a specific path -cd ~/trilium-flathub +cd ~/trilium-flathub || exit if ! git diff-index --quiet HEAD --; then echo "There are uncommitted changes" exit 1 fi +BASE_BRANCH=master + if [[ "$VERSION" == *"beta"* ]]; then - git switch beta -else - git switch master + BASE_BRANCH=beta fi +git switch "${BASE_BRANCH}" git pull +BRANCH=b${VERSION} + +git branch "${BRANCH}" +git switch "${BRANCH}" + echo "Updating files with version ${VERSION}, date ${VERSION_DATE} and commit ${VERSION_COMMIT}" flatpak-node-generator npm ../trilium/package-lock.json @@ -45,4 +51,7 @@ git add ./com.github.zadam.trilium.metainfo.xml git add ./com.github.zadam.trilium.yml git commit -m "release $VERSION" -git push +git push --set-upstream origin "${BRANCH}" + +gh pr create --fill -B "${BASE_BRANCH}" +gh pr merge --auto --merge --delete-branch