Skip to content

Commit

Permalink
Release 2024.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ómar Högni Guðmarsson committed Apr 3, 2024
1 parent 0679100 commit e92e1cc
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/scripts/sanity_check_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Verify that the version string matches in all locations
# Run this script from the root level of your tfc project
# not inside the scripts folder
import json
import re

# Read and parse the json file
def read_and_parse(filename: 'string'):
with open(filename, 'r') as f:
return json.loads(f.read())


# Return the vcpkg version string
def vcpkg_version_string():
return read_and_parse('vcpkg.json')["version"]

# Return the base cmake version
def cmake_project_version():
cmake_contents = ""
with open("CMakeLists.txt", "r") as f:
cmake_contents = f.read()

## Use regex and try and find the version of the format "2023.10.2"
p = re.compile(r'\d{4}\.\d{1,2}.\d*')
version_strings = p.findall(cmake_contents)
if len(version_strings) != 1:
print("Multiple possible versions found {version_strings}")
exit(-1)
return version_strings[0]

if __name__ == "__main__":
vcpkg_version = vcpkg_version_string()
cmake_version = cmake_project_version()
print(f"vcpkg version {vcpkg_version}")
print(f"Cmake version {cmake_version}")

if cmake_version != vcpkg_version:
print("cmake_version and vcpkg_version dont match!")
exit(-1)

exit(0)
18 changes: 18 additions & 0 deletions .github/workflows/sanity_check_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: sanity_check_version

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
check:
name: 'Check version strings'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check
run: |
python .github/scripts/sanity_check_version.py
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.25)
project(modbus
VERSION
0.0.1
2024.4.1
DESCRIPTION
"Boost asio based modbus library"
LANGUAGES
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modbus",
"version": "0.0.1",
"version": "2024.4.1",
"description": "Modbus protocol implementation, based on boost asio",
"dependencies": [
"asio",
Expand Down

0 comments on commit e92e1cc

Please sign in to comment.