diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 0000000..4a93a5f --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,23 @@ +name: Update version in meson.build + +on: + push: + paths: + - "src/version.h" + +jobs: + update-version: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - run: | + VERSION_MAJOR=$(grep BEST_SOURCE_VERSION_MAJOR src/version.h | cut -d " " -f 3) + VERSION_MINOR=$(grep BEST_SOURCE_VERSION_MINOR src/version.h | cut -d " " -f 3) + sed -i -E -e "s/version: '[0-9]+.[0-9]+'/version: '${VERSION_MAJOR}.${VERSION_MINOR}'/" meson.build + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Update version in meson.build + file_pattern: meson.build diff --git a/meson.build b/meson.build index 6017b15..cc1e73a 100644 --- a/meson.build +++ b/meson.build @@ -2,10 +2,7 @@ project('BestSource', 'cpp', default_options: ['buildtype=release', 'b_ndebug=if-release', 'cpp_std=c++17'], license: 'MIT', meson_version: '>=0.53.0', - version: '.'.join([ - run_command('grep', 'BEST_SOURCE_VERSION_MAJOR', 'src/version.h', check: true).stdout().strip().split()[2], - run_command('grep', 'BEST_SOURCE_VERSION_MINOR', 'src/version.h', check: true).stdout().strip().split()[2], - ]) + version: '9.0', ) api_sources = files(