From ab2357b9b74c2da33bb571d1727b7444e9c0031d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 01:11:21 +0000 Subject: [PATCH 1/2] Update GitHub Actions workflow for Pyraview - Update 'Package Binaries' step to use 7-Zip on Windows runners to fix zip failures. - Simplify packaging logic for non-Windows platforms. - Update 'Package Toolbox' step to package the MATLAB toolbox programmatically, using the GitHub release tag for the version number and 'Pyraview Team' as the author. - Create a complete .prj file with a fixed GUID for toolbox packaging. --- .github/workflows/build_and_release.yml | 53 +++++++++++++++++++++---- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 3c34b16..cddabad 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -49,12 +49,11 @@ jobs: run: | mkdir -p dist if [ "${{ runner.os }}" == "Windows" ]; then - # Windows CMake builds output to bin due to our CMakeLists.txt fix - zip -j dist/pyraview-win-x64.zip build/bin/*.dll build/bin/*.exe - elif [ "${{ runner.os }}" == "macOS" ]; then - zip -j dist/pyraview-mac-arm.zip build/bin/*.dylib build/bin/run_tests + # Use 7-Zip (pre-installed on Windows runners) + # 'a' is add, '-j' junk paths (like zip -j) + 7z a -tzip dist/pyraview-win-x64.zip ./build/bin/*.dll ./build/bin/*.exe else - zip -j dist/pyraview-linux-x64.zip build/bin/*.so build/bin/run_tests + zip -j dist/pyraview-${{ runner.os }}-${{ runner.arch }}.zip build/bin/* fi - name: Upload Artifacts @@ -127,10 +126,50 @@ jobs: # Run the packaging command - name: Package Toolbox uses: matlab-actions/run-command@v2 + env: + GITHUB_REF_NAME: ${{ github.ref_name }} with: command: | - opts = matlab.addons.toolbox.ToolboxOptions('toolboxPackaging.prj'); - matlab.addons.toolbox.packageToolbox(opts); + % 1. Use a fixed, permanent UUID for the project + % This ensures MATLAB treats every build as an update to the same toolbox + guid = '6e14a2b9-7f3c-4d8e-9a1b-3c5d7e9f2a4b'; + + % 2. Grab the version from the GitHub Tag environment variable + % Default to 1.0.0 if not running in a tagged action + version = getenv('GITHUB_REF_NAME'); + if isempty(version) || ~startsWith(version, 'v') + version = '1.0.0'; + else + % Remove the 'v' prefix (e.g., 'v1.2.3' -> '1.2.3') + version = erase(version, 'v'); + end + + % 3. Create a structurally complete, valid Toolbox PRJ XML + xmlCode = [... + '', ... + '', ... + '', ... + 'Pyraview', ... + 'Pyraview Team', ... + 'High-performance decimation engine.', ... + '' version '', ... + '${PROJECT_ROOT}/Pyraview.mltbx', ... + '' guid '', ... + '${PROJECT_ROOT}/src/matlab', ... + '${PROJECT_ROOT}/src/matlab', ... + '${PROJECT_ROOT}/Pyraview.mltbx', ... + '', ... + '/usr/local/matlab', ... + '']; + + % 4. Write the file + fid = fopen('pyraview.prj', 'w'); + fprintf(fid, '%s', xmlCode); + fclose(fid); + + % 5. Package using the file directly + fprintf('Packaging Pyraview version %s with GUID %s...\n', version, guid); + matlab.addons.toolbox.packageToolbox('pyraview.prj', 'Pyraview.mltbx'); # Upload the .mltbx as an artifact so the release job can pick it up - name: Upload Toolbox Artifact From 22b683c92feb52d56253f1ccaac658b3cebe3708 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 01:27:47 +0000 Subject: [PATCH 2/2] Update GitHub Actions workflow for Pyraview - Update 'Package Binaries' step to use 7-Zip on Windows runners to fix zip failures. - Simplify packaging logic for non-Windows platforms. - Update 'Package Toolbox' step to package the MATLAB toolbox programmatically, using the GitHub release tag for the version number and 'Pyraview Team' as the author. - Create a complete .prj file with a fixed GUID for toolbox packaging. - Enable 'workflow_dispatch' on release jobs to allow manual triggering without tags. --- .github/workflows/build_and_release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index cddabad..fa00ae2 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -44,7 +44,7 @@ jobs: # Zip binaries for release (naming by OS/Architecture) - name: Package Binaries - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' shell: bash run: | mkdir -p dist @@ -57,7 +57,7 @@ jobs: fi - name: Upload Artifacts - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v4 with: name: binaries-${{ matrix.os }} @@ -96,7 +96,7 @@ jobs: select-by-folder: src/matlab - name: Upload MEX Artifact - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v4 with: name: mex-${{ matrix.os }} @@ -106,7 +106,7 @@ jobs: package-matlab: name: Package Matlab Toolbox needs: build-matlab - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -181,7 +181,7 @@ jobs: release: name: Create GitHub Release needs: [build_and_test, package-matlab] - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest permissions: contents: write # Required to create releases