ci: add check if inno version and pubspec version match

This commit is contained in:
Tien Do Nam
2024-02-25 18:01:32 +01:00
parent 9200095304
commit 78b90d3c0f
2 changed files with 29 additions and 1 deletions

View File

@@ -47,3 +47,31 @@ jobs:
- name: Test
working-directory: app
run: flutter test
packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version from pubspec.yaml
id: pubspec_version
run: |
VERSION=$(grep '^version: ' app/pubspec.yaml | sed 's/version: //' | sed 's/\+.*//')
echo "Pubspec version is $VERSION"
echo "pubspec_version=$VERSION" >> $GITHUB_ENV
- name: Extract version from Inno Setup configuration
id: inno_version
run: |
VERSION=$(grep '#define MyAppVersion ' scripts/compile_windows_exe-inno.iss | sed 's/#define MyAppVersion "//' | sed 's/"//')
echo "Inno Setup version is $VERSION"
echo "inno_version=$VERSION" >> $GITHUB_ENV
- name: Compare pubspec and Inno Setup versions
run: |
if [ "$pubspec_version" != "$inno_version" ]; then
echo "Version mismatch detected!"
exit 1
else
echo "Versions match."
fi