diff --git a/.github/workflows/releaseDeploy.yml b/.github/workflows/releaseDeploy.yml index c23a79d65..2b664801c 100644 --- a/.github/workflows/releaseDeploy.yml +++ b/.github/workflows/releaseDeploy.yml @@ -111,7 +111,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{github.workspace}}/artifacts/rayx-win64.zip/rayx-win64.zip + asset_path: ${{github.workspace}}/artifacts/rayx-win64.zip asset_name: rayx-win64.zip asset_content_type: application/zip @@ -121,7 +121,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{github.workspace}}/artifacts/rayx-Linux.deb/rayx-Linux.deb + asset_path: ${{github.workspace}}/artifacts/rayx-Linux.deb asset_name: rayx-Linux.deb asset_content_type: application/x-deb diff --git a/Scripts/release.py b/Scripts/release.py index e9ee1c28c..f7030d191 100644 --- a/Scripts/release.py +++ b/Scripts/release.py @@ -1,5 +1,6 @@ import subprocess import re +import os def get_current_version(): try: @@ -25,6 +26,21 @@ def increment_version(version, part='patch'): # Add the 'v' prefix back to the version number return f"v{major}.{minor}.{patch}" +def update_cmake_version(version): + try: + # Update root CMakeLists.txt + root_cmake_path = "CMakeLists.txt" + with open(root_cmake_path, "r") as file: + data = file.read() + data = re.sub(r'project\((\w+) VERSION \d+\.\d+\.\d+\)', f'project(\\1 VERSION {version})', data) + with open(root_cmake_path, "w") as file: + file.write(data) + print(f"Updated {root_cmake_path}") + + except Exception as e: + print(f"Error updating CMakeLists.txt: {e}") + + def main(): current_version = get_current_version() print(f"Current version: {current_version}") @@ -38,17 +54,14 @@ def main(): print("Error: Version must follow vMAJOR.MINOR.PATCH format.") return - doc_updated = input("Have you updated the docs/changes/lastChanges.md file? [y/N]: ").strip().lower() - if doc_updated not in ('y', 'yes'): - print("Please update the docs/changes/lastChanges.md file before proceeding.") - return - confirmation = input(f"Are you sure you want to tag and commit as {new_version}? [Y/n]: ").strip().lower() if confirmation not in ('y', 'yes', ''): print("Aborted.") return try: + # Update CMakeLists.txt + update_cmake_version(new_version) subprocess.run(["git", "tag", "-a", new_version, "-m", f"Version {new_version}"], check=True) print(f"Successfully tagged with {new_version}") # Provide the user with the command to push the tag diff --git a/docs/changes/README.md b/docs/changes/README.md deleted file mode 100644 index 1eafd6c4b..000000000 --- a/docs/changes/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# How to create release - -- does dev testsuite run successfully? -- merge dev into master -- archive old lastChanges.md file according to semver -- replace contents of lastChanges.md with new changes -- create new commit ("Release commit") and DON'T forget to tag the commit (SemVer) -- push to master \ No newline at end of file diff --git a/docs/changes/lastChanges.md b/docs/changes/lastChanges.md deleted file mode 100644 index 485cd9972..000000000 --- a/docs/changes/lastChanges.md +++ /dev/null @@ -1,26 +0,0 @@ -# Changes - -- rayx-core: - - Added optical elements - - Paraboloid - - Added light sources - - Simple Undulator - - Pixel Source - - Dipole Source - - Improved code consistency for optical elements and light sources - - Improved test suite - - Fixes for RZP tracing -- rayx: - - Added more options to customize the export of rays and speed up the tracing - - Added option to choose GPU - - Improved runtime by optimizing data handling -- rayx-ui: - - Added orthographic camera - - Added footprints/heatmaps/histograms for simple optical elements - - Changed default camera position and orientation - - Jump to light source is possible now - - Correctly render slits - - Fixed positioning of light sources - - Fixed triangulation bugs - - Fixed general rendering bugs -- General bugfixes and documentation updates \ No newline at end of file