From 00362c5be453c66931aae99991481b7b2c88755d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 8 Apr 2024 14:43:42 +0100 Subject: [PATCH] ci: make sure version Cargo.toml matches version in meson.build Part-of: --- .gitlab-ci.yml | 1 + ci/check-meson-version.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 ci/check-meson-version.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6049f232..a02bf21e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -315,6 +315,7 @@ check commits: script: - ci-fairy check-commits --textwidth 0 --no-signed-off-by - ci/check-for-symlinks.sh + - ci/check-meson-version.sh clippy: extends: '.debian:12-stable' diff --git a/ci/check-meson-version.sh b/ci/check-meson-version.sh new file mode 100755 index 00000000..e131b03c --- /dev/null +++ b/ci/check-meson-version.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +MESON_VERSION=`head -n5 meson.build | grep ' version\s*:' | sed -e "s/.*version\s*:\s*'//" -e "s/',.*//"` +CARGO_VERSION=`cat Cargo.toml | grep -A1 workspace.package | grep ^version | sed -e 's/^version = "\(.*\)"/\1/'` + +echo "gst-plugins-rs version (meson.build) : $MESON_VERSION" +echo "gst-plugins-rs version (Cargo.toml) : $CARGO_VERSION" + +if test "x$MESON_VERSION" != "x$CARGO_VERSION"; then + echo + echo "===> Version mismatch between meson.build and Cargo.toml! <===" + echo + exit 1; +fi