@@ -301,127 +301,45 @@ jobs:
301301 compression-level : 0
302302 retention-days : 1
303303
304- build-64-bit- addon :
305- name : build-64-bit- addon
304+ build-addon :
305+ name : build-addon
306306 continue-on-error : false
307- needs : [l10n, zip-rules, rust-64]
307+ needs : [l10n, zip-rules, rust-32, rust- 64]
308308 runs-on : ubuntu-latest
309309 steps :
310310 - name : Checkout code
311311 uses : actions/checkout@v5
312- # download the 64 build
313- - name : Download 64 bit build
314- uses : actions/download-artifact@v8
315- with :
316- name : libmathcat_py-64-3.13-win.zip
317- # download the Rules dir (not part of checkout)
318- - name : Download 64 bit build
319- uses : actions/download-artifact@v8
320- with :
321- name : Rules.zip
322- - name : Download Rules-minimized.zip
323- uses : actions/download-artifact@v8
324- with :
325- name : Rules-minimized.zip
326- # put things where they belong
327- - name : Set up addons dir
328- run : |
329- unzip libmathcat_py-64-3.13-win.zip
330- mv libmathcat_py.pyd Rules.zip addon/globalPlugins/MathCAT
331- cd addon/globalPlugins/MathCAT
332- sed 's/^import wx\.xrc/# import wx.xrc/' --in-place MathCATgui.py # fix wx file
333- unzip Rules.zip
334- rm Rules.zip
335- # build the addon
336- - name : Set up Python
337- uses : actions/setup-python@v5
338- with :
339- python-version : 3.13 # needed for scons
340- - name : Install scons dependencies
341- run : |
342- pip install scons markdown
343- sudo apt update
344- sudo apt install gettext
345- - name : Sync addon version from MathCAT (prefer matching branch)
346- shell : bash
347- run : |
348- if [ -n "${GITHUB_HEAD_REF:-}" ]; then
349- REF="$GITHUB_HEAD_REF"
350- else
351- REF="${GITHUB_REF#refs/heads/}"
352- fi
353- echo "Detected ref: $REF"
354- REMOTE=https://github.com/NSoiffer/MathCAT.git
355-
356- if git ls-remote --heads "$REMOTE" "$REF" | grep -q "refs/heads/$REF"; then
357- echo "Using MathCAT branch $REF to get version"
358- VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/$REF/Cargo.toml \
359- | sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
360- else
361- echo "No matching branch in MathCAT; using latest tag"
362- VERSION=$(curl -fsSL https://raw.githubusercontent.com/NSoiffer/MathCAT/latest/Cargo.toml \
363- | sed -n 's/^version = "\(.*\)"/\1/p' | head -n1)
364- fi
365-
366- if [ -z "$VERSION" ]; then
367- echo "Failed to read MathCAT version" >&2
368- exit 1
369- fi
370- echo "Syncing addon_version to MathCAT $VERSION"
371- sed -i "s/\"addon_version\": \"[^\"]*\"/\"addon_version\": \"$VERSION\"/" buildVars.py
372- - name : Run scons to build .addon file
373- run : |
374- scons
375- - name : Rename addon for 64-bit
376- run : |
377- for f in *.nvda-addon; do
378- mv "$f" "${f%.nvda-addon}-64.nvda-addon"
379- done
380- ls -l *.nvda-addon
381- - name : Upload the addon
382- uses : actions/upload-artifact@v7
383- with :
384- name : addon-64
385- path : " *.nvda-addon"
386- compression-level : 0
387- retention-days : 1
388-
389- build-32-bit-addon :
390- name : build-32-bit-addon
391- continue-on-error : false
392- needs : [l10n, zip-rules, rust-32]
393- runs-on : ubuntu-latest
394- steps :
395- - name : Checkout code
396- uses : actions/checkout@v5
397- # download the 32 build
398312 - name : Download 32 bit build
399313 uses : actions/download-artifact@v8
400314 with :
401315 name : libmathcat_py-32-3.11-win.zip
402- # download the Rules dir (not part of checkout)
403- - name : Download 32 bit build
316+ - name : Download 64 bit build
404317 uses : actions/download-artifact@v8
405318 with :
406- name : Rules .zip
407- - name : Download Rules-minimized .zip
319+ name : libmathcat_py-64-3.13-win .zip
320+ - name : Download Rules.zip
408321 uses : actions/download-artifact@v8
409322 with :
410- name : Rules-minimized .zip
323+ name : Rules.zip
411324 # put things where they belong
412325 - name : Set up addons dir
413326 run : |
414- unzip libmathcat_py-32-3.11-win.zip
415- mv libmathcat_py.pyd Rules.zip addon/globalPlugins/MathCAT
327+ mkdir -p tmp32 tmp64
328+ unzip -o libmathcat_py-32-3.11-win.zip -d tmp32
329+ unzip -o libmathcat_py-64-3.13-win.zip -d tmp64
330+ mv tmp32/libmathcat_py.pyd addon/globalPlugins/MathCAT/libmathcat_py_x86.pyd
331+ mv tmp64/libmathcat_py.pyd addon/globalPlugins/MathCAT/libmathcat_py_x64.pyd
332+ mv Rules.zip addon/globalPlugins/MathCAT
416333 cd addon/globalPlugins/MathCAT
417334 sed 's/^import wx\.xrc/# import wx.xrc/' --in-place MathCATgui.py # fix wx file
418335 unzip Rules.zip
419336 rm Rules.zip
337+ ls -l libmathcat_py_*.pyd
420338 # build the addon
421339 - name : Set up Python
422340 uses : actions/setup-python@v5
423341 with :
424- python-version : 3.11 # needed for scons
342+ python-version : 3.13 # needed for scons
425343 - name : Install scons dependencies
426344 run : |
427345 pip install scons markdown
@@ -454,35 +372,22 @@ jobs:
454372 fi
455373 echo "Syncing addon_version to MathCAT $VERSION"
456374 sed -i "s/\"addon_version\": \"[^\"]*\"/\"addon_version\": \"$VERSION\"/" buildVars.py
457- - name : Update NVDA Version Constraints
458- run : |
459- # Adjust the version numbers for the old 32 bit NVDA version
460- sed -i 's/"addon_name": "MathCAT"/"addon_name": "MathCAT-for-NVDA2025"/' buildVars.py
461- sed -i 's/"addon_summary": _("MathCAT:/"addon_summary": _("MathCAT-for-NVDA2025:/' buildVars.py
462- sed -i 's/"addon_minimumNVDAVersion": "[^"]*"/"addon_minimumNVDAVersion": "2025.1"/' buildVars.py
463- sed -i 's/"addon_lastTestedNVDAVersion": "[^"]*"/"addon_lastTestedNVDAVersion": "2025.3"/' buildVars.py
464- cat buildVars.py
465375 - name : Run scons to build .addon file
466376 run : |
467377 scons
468- - name : Rename addon for 32-bit
469- run : |
470- for f in *.nvda-addon; do
471- mv "$f" "${f%.nvda-addon}-32.nvda-addon"
472- done
473- ls -l *.nvda-addon
378+ ls -l *.nvda-addon
474379 - name : Upload the addon
475380 uses : actions/upload-artifact@v7
476381 with :
477- name : addon-32
382+ name : addon
478383 path : " *.nvda-addon"
479384 compression-level : 0
480385 retention-days : 1
481386
482387 pre-release :
483388 name : Pre Release
484389 continue-on-error : false
485- needs : [zip-rules, rust-32, rust-64, linux-64, build-32-bit-addon, build-64-bit- addon]
390+ needs : [zip-rules, rust-32, rust-64, linux-64, build-addon]
486391 runs-on : ubuntu-latest
487392 steps :
488393 - name : Checkout code
@@ -509,18 +414,15 @@ jobs:
509414 uses : actions/download-artifact@v8
510415 with :
511416 name : libmathcat_py-64-3.13-linux.zip
512- - name : Download 64-bit addon
417+ - name : Download addon
513418 uses : actions/download-artifact@v8
514419 with :
515- name : addon-64
516- - name : Download 32-bit addon
517- uses : actions/download-artifact@v8
518- with :
519- name : addon-32
520- - name : Consolidate addon files
420+ name : addon
421+ path : release-addon
422+ - name : Place addon in release dir
521423 run : |
522- mv addon-64 /*.nvda-addon . 2>/dev/null || true
523- mv addon-32/ *.nvda-addon . 2>/dev/null || true
424+ mv release-addon /*.nvda-addon .
425+ ls -l *.nvda-addon
524426 - name : Get MathCAT version for release title
525427 id : mathcat-version
526428 shell : bash
0 commit comments