From 1185d1e7e184905d9ec7d66e7f751623aa82aef0 Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Tue, 2 Jan 2024 15:15:21 +0000 Subject: [PATCH] Add update.yml --- .github/workflows/update.yml | 18 ++++++++++++++++++ release/release.sh | 10 +++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..ae627b5 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,18 @@ +name: Update Restate version + +on: + workflow_call: + workflow_dispatch: + +jobs: + publish-release: + name: Publish release + runs-on: ubuntu-latest + + steps: + - name: setup git config + run: | + git config user.name "GitHub Actions Bot" + git config user.email "<>" + - run: ./release/release.sh + - run: git push origin main diff --git a/release/release.sh b/release/release.sh index 099eaef..f59a69c 100755 --- a/release/release.sh +++ b/release/release.sh @@ -9,4 +9,12 @@ linux_x86=$(curl --silent --location --fail "https://github.com/restatedev/resta linux_arm64=$(curl --silent --location --fail "https://github.com/restatedev/restate/releases/download/v${version}/restate.aarch64-unknown-linux-gnu.tar.gz" | sha256sum | awk '{print $1}') export version darwin_x86 darwin_arm64 linux_x86 linux_arm64 -envsubst < "${SCRIPT_DIR}/restate.rb.tmpl" > "${SCRIPT_DIR}/../formula/restate.rb" +envsubst < "${SCRIPT_DIR}/restate.rb.tmpl" > "${SCRIPT_DIR}/../Formula/restate.rb" + +git -C "${SCRIPT_DIR}/.." reset +git -C "${SCRIPT_DIR}/.." add "Formula/restate.rb" +if git diff --cached --exit-code; then + echo "Nothing to commit" +else + git -C "${SCRIPT_DIR}/.." commit -m "Update to ${version}" +fi