Skip to content

Commit

Permalink
Pull updater out into a script
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltoli committed Mar 7, 2024
1 parent 6247a54 commit 863d5db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/update-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,7 @@ jobs:
git config user.email [email protected]
- 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>.*</scala-kore.version>$! <scala-kore.version>'"${SCALA_KORE_VERSION}"'</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
16 changes: 16 additions & 0 deletions scripts/update-scala-kore.sh
Original file line number Diff line number Diff line change
@@ -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>.*</scala-kore.version>$! <scala-kore.version>'"${SCALA_KORE_VERSION}"'</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

0 comments on commit 863d5db

Please sign in to comment.