diff --git a/Makefile b/Makefile index 14ba948bd2..1e47512da8 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,7 @@ kore-exec: $(KORE_EXEC) k-frontend: mkdir -p $(BUILD_DIR) rm -rf $(K_DIST_DEFAULT) $(K_NIGHTLY) - curl --location --output $(K_NIGHTLY) \ - $$(curl 'https://api.github.com/repos/kframework/k/releases' | jq --raw-output '.[${K_NIGHTLY_OFFSET}].assets[].browser_download_url | match(".*nightly.tar.gz").string') + curl --location --output $(K_NIGHTLY) $(K_NIGHTLY_URL) mkdir -p $(K_DIST_DEFAULT) tar --extract --file $(K_NIGHTLY) --strip-components 1 --directory $(K_DIST_DEFAULT) $(KRUN) --version diff --git a/include.mk b/include.mk index be77fb66c9..e398b63e57 100644 --- a/include.mk +++ b/include.mk @@ -5,7 +5,7 @@ UPSTREAM_BRANCH = origin/master BUILD_DIR = $(TOP)/.build K_NIGHTLY = $(BUILD_DIR)/nightly.tar.gz -K_NIGHTLY_OFFSET ?= 0 +K_NIGHTLY_URL = https://github.com/kframework/k/releases/download/nightly-4375ba02b/nightly.tar.gz K_DIST_DEFAULT = $(BUILD_DIR)/k K_DIST ?= $(K_DIST_DEFAULT) K_DIST_BIN = $(K_DIST)/bin diff --git a/scripts/update-k-nightly-pr.sh b/scripts/update-k-nightly-pr.sh new file mode 100755 index 0000000000..3c43d7e9db --- /dev/null +++ b/scripts/update-k-nightly-pr.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -exuo pipefail + +export TOP=${TOP:-$(git rev-parse --show-toplevel)} +UPSTREAM_REMOTE=${UPSTREAM_REMOTE:-origin} +UPSTREAM_BRANCH=master +BRANCH_NAME=update-k-nightly + +$TOP/scripts/git-assert-clean.sh + +if [[ $(git rev-parse HEAD) != $(git rev-parse $UPSTREAM_BRANCH) ]]; then + echo "Must run with $UPSTREAM_BRANCH checked out!!!" + exit 1 +fi + +$TOP/scripts/update-k-nightly.sh + +if $TOP/scripts/git-assert-clean.sh; then + echo "No update..." + exit 0 +fi + +git checkout -B "$BRANCH_NAME" "$UPSTREAM_REMOTE/$UPSTREAM_BRANCH" + +git add $TOP/include.mk + +git commit --message 'include.mk: update K nightly version' + +hub pull-request --push --force --head "$BRANCH_NAME" --base "$UPSTREAM_BRANCH" --reviewer ehildenb --file - <