Skip to content

Commit 6cbf5fd

Browse files
authored
Version check job (#1974)
* Version check job * Working Version check template * Retest with dev * Version lint * Version lint
1 parent bf43342 commit 6cbf5fd

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ jobs:
703703
cmake .. -DBUILD_STATIC_LIBS=ON -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
704704
make
705705
- name: Verify library is ARM64 type
706-
run: |
706+
run: |
707707
cd scripts
708708
chmod +x verify_lib.sh
709709
./verify_lib.sh ../build/libkvsWebrtcClient.a "ARM64"

Diff for: .github/workflows/version-check.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Version Mismatch between PR branch and master.
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check-version:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout PR branch
13+
uses: actions/checkout@v4
14+
15+
- name: Get version from PR
16+
id: pr_version
17+
run: |
18+
PR_VERSION=$(grep -Po 'KinesisVideoWebRTCClient VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
19+
echo "PR_VERSION=$PR_VERSION" >> "$GITHUB_ENV"
20+
echo "PR Version: $PR_VERSION"
21+
22+
- name: Checkout master branch
23+
uses: actions/checkout@v4
24+
with:
25+
ref: master
26+
27+
- name: Get version from master
28+
id: master_version
29+
run: |
30+
MASTER_VERSION=$(grep -Po 'KinesisVideoWebRTCClient VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
31+
echo "MASTER_VERSION=$MASTER_VERSION" >> "$GITHUB_ENV"
32+
echo "Master version: $MASTER_VERSION"
33+
34+
- name: Compare versions
35+
run: |
36+
echo "Comparing PR Version: $PR_VERSION with Master Version: $MASTER_VERSION"
37+
if [ "$MASTER_VERSION" == "$PR_VERSION" ]; then
38+
echo "Please update the version in CMakeLists.txt file (project(KinesisVideoWebRTCClient VERSION <ver-string> LANGUAGES C). Any PR getting merged to master requires a version update"
39+
exit 1
40+
else
41+
echo "Version update detected."
42+
fi

0 commit comments

Comments
 (0)