build: add make fetch-gui-and-commit to fetch and commit the embedded GUI
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user