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

v1.3.0 #43

Merged
merged 37 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ea1285f
move src files for refactor
LeoKle Mar 18, 2024
41e80f3
add workflows
LeoKle Mar 18, 2024
77652be
init plugin for refactor
LeoKle Mar 18, 2024
f26d0ef
add types
LeoKle Mar 18, 2024
812c60b
add async Logger
LeoKle Mar 23, 2024
4f99d13
init DataManager
LeoKle Mar 23, 2024
8fca326
add utils
LeoKle Mar 23, 2024
1479ac9
handle OnAirportRunwayActivityChanged event
LeoKle Mar 23, 2024
d8f6c83
subscribe to flightplan data update events
LeoKle Mar 24, 2024
e619f18
init Server.cpp
LeoKle Mar 24, 2024
eef4d00
add backend pilot data fetching and consolidation
LeoKle Mar 24, 2024
482dde9
add pilot posting and patching
LeoKle Mar 24, 2024
72b33c6
add TagItemFunctions using asynchronous messages
LeoKle Mar 27, 2024
c332980
improve responsiveness of tag functions
LeoKle Mar 29, 2024
f22658f
fix TOBT entry string to time point conversion
LeoKle Mar 29, 2024
45cba63
add config parsing
LeoKle Mar 29, 2024
aa17c08
add TagItems
LeoKle Mar 29, 2024
6f8ce73
fix TOBT patch messages
LeoKle Mar 29, 2024
5be5f29
move handling of tag items and functions to separate file
LeoKle Mar 29, 2024
7f115db
add CompileCommands
LeoKle Mar 30, 2024
39c2b29
fix EXOT display and parsing
LeoKle Mar 30, 2024
69b01e5
only handle tag functions if client is master
LeoKle Mar 30, 2024
4613d27
add reset TagItem functions
LeoKle Mar 30, 2024
372a1fb
add update rate to config
LeoKle Mar 31, 2024
b57ac0f
add config file and to build & workflow releases
LeoKle Mar 31, 2024
1cb9fba
exclude sqlite3 from clang format
LeoKle Mar 31, 2024
a4dbbab
remove old src files
LeoKle Mar 31, 2024
594ffb7
set build-develop workflow to build config release
LeoKle Mar 31, 2024
0b7d2f2
set default URL to prod URL
LeoKle Apr 1, 2024
a4ee66c
fix temporary EXOT reset on EXOT update
LeoKle Apr 4, 2024
3c66599
fix AORT update sending AOBT update
LeoKle Apr 4, 2024
4e53922
v1.3.1
LeoKle Apr 5, 2024
cf672d8
set new prod URL
LeoKle Apr 8, 2024
1701450
amend workflow build and versioning
LeoKle Apr 6, 2024
c91928e
add compile commands for logging
LeoKle Apr 9, 2024
f4d1e8e
fix access violation error
LeoKle Apr 14, 2024
20d0e7a
set main release to create draft
LeoKle Apr 16, 2024
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
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Build Plugin Dev Release

on:
push:
branches:
- "develop"

env:
DLL_NAME: vACDM.dll
BUILD_CONFIGURATION: Release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: "0"
DEV_RELEASE: "-1"

jobs:
formatting-check:
uses: ./.github/workflows/clang-format.yml

build:
needs: formatting-check
runs-on: windows-latest
name: "Build plugin"

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub

- name: Run version handler
env:
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
run: |
python .github/workflows/version_handler.py

- name: Determine DEV_RELEASE value
id: find_latest_dev_release
env:
REPOSITORY: ${{ github.repository }}
run: python .github/workflows/determine_dev_release.py

- name: Install MSVC toolset
run: choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"

- name: Set up MSVC environment
shell: pwsh
run: |
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_CONFIGURATION}} -A Win32 -DDEV_BUILD=ON -DDEV_RELEASE_NUMBER="${{ env.DEV_RELEASE }}"

- name: Build DLL
run: cmake --build build --config ${{env.BUILD_CONFIGURATION}}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
draft: true # to allow amendment of release notes
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/${{env.BUILD_CONFIGURATION}}/${{env.DLL_NAME}}
asset_name: ${{env.DLL_NAME}}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload config file (vacdm.txt)
id: upload-release-asset-txt
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: src/config/vacdm.txt
asset_name: vacdm.txt
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89 changes: 89 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build Plugin Release

on:
push:
branches:
- main

env:
DLL_NAME: vACDM.dll
BUILD_CONFIGURATION: Release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: "0"

jobs:
formatting-check:
uses: ./.github/workflows/clang-format.yml

build:
needs: formatting-check
runs-on: windows-latest
name: "Build plugin"

steps:
- uses: actions/checkout@v3

- name: Install MSVC toolset
run: choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub

- name: Run version handler
env:
REPOSITORY: ${{ github.repository }}
REF: ${{ github.ref }}
run: |
python .github/workflows/version_handler.py

- name: Set up MSVC environment
shell: pwsh
run: |
Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"

- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_CONFIGURATION}} -A Win32

- name: Build DLL
run: cmake --build build --config ${{env.BUILD_CONFIGURATION}}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
draft: true # to allow amendment of release notes
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/${{env.BUILD_CONFIGURATION}}/${{env.DLL_NAME}}
asset_name: ${{env.DLL_NAME}}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload config file (vacdm.txt)
id: upload-release-asset-txt
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: src/config/vacdm.txt
asset_name: vacdm.txt
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: clang-format Check
on: [workflow_call, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/[email protected]
with:
clang-format-version: "13"
check-path: "src"
fallback-style: "Google"
exclude-regex: "(sqlite3)"
25 changes: 25 additions & 0 deletions .github/workflows/cmake_project_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
""" Finds the project version defined in CMakeLists.txt"""

import sys
import re


def extract_version_from_cmakelists():
# Define the pattern to search for in the file
pattern = r'PROJECT\(.*?VERSION\s+"(\d+\.\d+\.\d+)"'

# Read the contents of CMakeLists.txt
with open("CMakeLists.txt", "r") as file:
contents = file.read()

# Search for the pattern
match = re.search(pattern, contents)

# If a match is found, extract the version
if match:
print("Found version number in CMakeLists.txt: ", match.group(1))
return match.group(1)

# exit if the version could not be found
print("Could not find version in CMakeLists.txt")
sys.exit(1)
57 changes: 57 additions & 0 deletions .github/workflows/determine_dev_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import sys
import re
from github import Github


def parse_semantic_version(version):
# Parse the semantic version and extract major and minor versions
match = re.match(r"v?(\d+)\.(\d+)\.(\d+)", version)
if match:
print(match.groups())
major, minor, patch = match.groups()
return int(major), int(minor), int(patch)
else:
return None


def find_highest_dev_release(repo, major, minor):
# Initialize a GitHub instance
g = Github()

# Get the repository object
repository = g.get_repo(repo)

# Fetch all releases
releases = repository.get_releases()

# Filter pre-releases with matching major and minor versions in their titles
pre_releases = [
release
for release in releases
if release.prerelease and release.title.startswith(f"v{major}.{minor}")
]

# Extract DEV_RELEASE numbers from titles
dev_releases = [int(release.title.split(".")[-1]) for release in pre_releases]

# Find the highest DEV_RELEASE number
highest_dev_release = max(dev_releases, default=0)

return highest_dev_release


def determine_dev_release(version, repository):
if version == "0":
result = 0
else:
# Parse the semantic version to extract major and minor versions
major, minor, _ = parse_semantic_version(version)
if major is not None and minor is not None:
result = find_highest_dev_release(repository, major, minor)
else:
print("Invalid semantic version format")
sys.exit(1)

print("Determined dev release version as ", result)

return result
34 changes: 34 additions & 0 deletions .github/workflows/version_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
""" """

import sys
import os
import re

from cmake_project_version import extract_version_from_cmakelists
from determine_dev_release import determine_dev_release

REPOSITORY_NAME = os.environ.get("REPOSITORY")
REF = os.environ.get("REF")

# determine the branch that triggered the workflow
match = re.match(r"refs/heads/(.*)", REF)
if not match:
sys.exit(1)

branch_name = match.group(1)
print("Determined branch name: ", branch_name)

version = extract_version_from_cmakelists()

is_dev_branch = branch_name == "develop"
dev_release = None
if is_dev_branch:
last_dev_release = determine_dev_release(version, REPOSITORY_NAME)
dev_release = str(last_dev_release + 1)
version += "-dev." + dev_release

# Write the version and dev release to GitHub environment variable
with open(os.getenv("GITHUB_ENV"), "a") as env_file:
env_file.write(f"VERSION={version}\n")
if is_dev_branch and dev_release:
env_file.write(f"DEV_RELEASE={dev_release}\n")
Loading
Loading