Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version check CI #1167

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ jobs:
Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "C:\amazon-kinesis-video-streams-producer-sdk-cpp"
- name: Install dependencies
run: |
choco install nasm strawberryperl
choco install nasm strawberryperl pkgconfiglite
choco install gstreamer --version=1.22.8
choco install gstreamer-devel --version=1.22.8
- name: Build repository
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check Version Mismatch between PR branch and master.

on:
pull_request:
branches:
- master

jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4

- name: Get version from PR
id: pr_version
run: |
PR_VERSION=$(grep -Po 'KinesisVideoProducerCpp VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
echo "PR_VERSION=$PR_VERSION" >> "$GITHUB_ENV"
echo "PR Version: $PR_VERSION"

- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: master

- name: Get version from master
id: master_version
run: |
MASTER_VERSION=$(grep -Po 'KinesisVideoProducerCpp VERSION \K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
echo "MASTER_VERSION=$MASTER_VERSION" >> "$GITHUB_ENV"
echo "Master version: $MASTER_VERSION"

- name: Compare versions
run: |
echo "Comparing PR Version: $PR_VERSION with Master Version: $MASTER_VERSION"
if [ "$MASTER_VERSION" == "$PR_VERSION" ]; then
echo "Please update the version in CMakeLists.txt file (project(KinesisVideoProducerCpp VERSION <ver-string> LANGUAGES C). Any PR getting merged to master requires a version update"
exit 1
else
echo "Version update detected."
fi
Loading