Skip to content

Commit

Permalink
version-check script
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvlv committed Jan 21, 2024
1 parent 85b5265 commit 4686541
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Check version consistency
run: bash scripts/version-check.sh

- name: Check tag name matches
run: if [ "${{github.ref_name}}" = "$(scripts/version-check.sh)" ]; then exit 0; else exit 1; fi

- name: Dependencies
run: sudo dnf install -y libadwaita-devel gtk4-devel make cargo gettext-devel zip

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ clean-flatpak:
rm -rf build-dir/*
rm -rf .flatpak-builder/*

version-check:
bash scripts/version-check.sh
8 changes: 8 additions & 0 deletions scripts/version-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
APPDATA_VER=$(grep '<release version="' io.github.dvlv.boxbuddyrs.metainfo.xml -m 1 | sed -n '/<release version="/s/<release version="//p' | sed 's/".*//' | sed 's/^[[:space:]]*//');
RUST_VER=$(grep "set_version" src/main.rs | sed -n '/d.set_version("/s/d.set_version("//p' | sed 's/.\{3\}$//' | sed 's/^[[:space:]]*//');
DIFF=$(if [ "$RUST_VER" = "$APPDATA_VER" ]; then echo 0; else echo 1; fi)

echo $APPDATA_VER;

exit $DIFF;

0 comments on commit 4686541

Please sign in to comment.