From 863d5dbeed9a30490b90bfb5891ce37887ad9bc4 Mon Sep 17 00:00:00 2001 From: Bruce Collie Date: Thu, 7 Mar 2024 11:22:47 +0000 Subject: [PATCH] Pull updater out into a script --- .github/workflows/clang-format-check.yml | 1 + .github/workflows/update-deps.yml | 16 +--------------- scripts/update-scala-kore.sh | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 15 deletions(-) create mode 100755 scripts/update-scala-kore.sh diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 610c54087..7a0646911 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -26,6 +26,7 @@ jobs: name: Check that shell scripts follow best practices with: scandir: './bin' + additional_files: './scripts/update-scala-kore.sh' clang-tidy-check: name: Clang Tidy check diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml index d37188304..4f9085768 100644 --- a/.github/workflows/update-deps.yml +++ b/.github/workflows/update-deps.yml @@ -26,21 +26,7 @@ jobs: git config user.email devops@runtimeverification.com - name: 'Update scala-kore release tag' - run: | - set -euxo pipefail - - SCALA_KORE_VERSION="$(cat matching/deps/scala_kore_release)" - changed=false - - sed -i 's!^ .*$! '"${SCALA_KORE_VERSION}"'!' matching/pom.xml - if git add matching/pom.xml && git commit -m "matching: update scala-kore to ${SCALA_KORE_VERSION}"; then - changed=true - fi - - if [ "${changed}" = "true" ]; then - sed -i 's! mvnHash = "sha256-.*";! mvnHash = "";!' nix/overlay.nix - git add nix/overlay.nix && git commit -m "nix: invalidate maven packages hash" || true - fi + run: ./scripts/update-scala-kore.sh - name: 'Push updates' run: git push diff --git a/scripts/update-scala-kore.sh b/scripts/update-scala-kore.sh new file mode 100755 index 000000000..9afe340db --- /dev/null +++ b/scripts/update-scala-kore.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +SCALA_KORE_VERSION="$(cat matching/deps/scala_kore_release)" +changed=false + +sed -i 's!^ .*$! '"${SCALA_KORE_VERSION}"'!' matching/pom.xml +if git add matching/pom.xml && git commit -m "matching: update scala-kore to ${SCALA_KORE_VERSION}"; then + changed=true +fi + +if [ "${changed}" = "true" ]; then + sed -i 's! mvnHash = "sha256-.*";! mvnHash = "";!' nix/overlay.nix + (git add nix/overlay.nix && git commit -m "nix: invalidate maven packages hash") || true +fi