feat: pre-check for git tag and project version

This commit is contained in:
Bart van der Braak 2023-11-07 23:24:44 +01:00
parent 8b033eea08
commit 609e4fe6da

View file

@ -5,9 +5,22 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
pre-check:
name: Pre-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
if [[ "$(git describe --tags --abbrev=0)" != "v$(grep -m1 -F 'version =' Cargo.toml | cut -d\" -f2)" ]]; then
echo "Error: The git tag does not match the Cargo.toml version."
exit 1
fi
echo "Success: The git tag matches the Cargo.toml version."
build:
needs: pre-check
strategy:
matrix:
name: