Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

build: add `make fetch-gui-and-commit` to fetch and commit the embedded GUI

Nick Craig-Woodd6377a283d15
diff --git a/Makefile b/Makefile
index 9ab411ea6..ab6b508ef 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ LINTTAGS=--build-tags "$(GOTAGS)"
endif
LDFLAGS=--ldflags "-s -X github.com/rclone/rclone/fs.Version=$(TAG)"
-.PHONY: rclone test_all vars version fetch-gui
+.PHONY: rclone test_all vars version fetch-gui fetch-gui-and-commit
rclone:
ifeq ($(GO_OS),windows)
@@ -62,6 +62,9 @@ endif
fetch-gui:
$(SHELL) ./bin/fetch-gui-dist.sh
+fetch-gui-and-commit:
+ $(SHELL) ./bin/fetch-gui-dist.sh --commit
+
test_all:
go install $(LDFLAGS) $(BUILDTAGS) $(BUILD_ARGS) github.com/rclone/rclone/fstest/test_all
diff --git a/RELEASE.md b/RELEASE.md
index 8ff7ca50b..8b5fcf914 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -11,6 +11,7 @@ This file describes how to make the various kinds of releases
- git checkout master # see below for stable branch
- git pull # IMPORTANT
+- make fetch-gui-and-commit # bump the embedded GUI if rclone-web has a newer release
- git status - make sure everything is checked in
- Check GitHub actions build for master is Green
- make test # see integration test server or run locally
diff --git a/bin/fetch-gui-dist.sh b/bin/fetch-gui-dist.sh
index 9346102ba..85e059734 100755
--- a/bin/fetch-gui-dist.sh
+++ b/bin/fetch-gui-dist.sh
@@ -18,6 +18,14 @@ DEST_DIR="cmd/gui"
ZIP_FILE="${DEST_DIR}/dist.zip"
TAG_FILE="${DEST_DIR}/dist.tag"
+COMMIT=0
+for arg in "$@"; do
+ case "$arg" in
+ --commit) COMMIT=1 ;;
+ *) echo "Unknown argument: $arg" >&2; exit 1 ;;
+ esac
+done
+
CURL_OPTS=(-fSs --retry 5 --retry-delay 2 --retry-all-errors)
# Use GITHUB_TOKEN (or GH_TOKEN) if present so that GitHub API calls are
@@ -78,3 +86,12 @@ chmod 644 "${ZIP_FILE}"
echo -n "${TAG}" > "${TAG_FILE}"
echo "Done. ${ZIP_FILE} updated to ${TAG}"
+
+if [ "${COMMIT}" -eq 1 ]; then
+ git add "${ZIP_FILE}" "${TAG_FILE}"
+ if git diff --cached --quiet -- "${ZIP_FILE}" "${TAG_FILE}"; then
+ echo "No changes to commit (zip and tag are identical to HEAD)"
+ else
+ git commit -m "gui: update embedded release to ${TAG}" -- "${ZIP_FILE}" "${TAG_FILE}"
+ fi
+fi