Skip to content

Remove lint action (#3) #2

Remove lint action (#3)

Remove lint action (#3) #2

name: automatic-release
on:
push:
branches:
- main
# schedule:
# # * is a special character in YAML so you have to quote this string
# - cron: '0 0 * * 6'
jobs:
l10n:
name: l10n
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Push l10n updates
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git remote add l10n https://github.com/nvdaaddons/MathCAT
git fetch l10n
git reset l10n/stable addon/doc addon/locale
git commit -m "Update translations" --allow-empty
git pull
git push
zip-rules:
name: zip up the rules directory
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Rust Library
run: |
cargo build --target x86_64-unknown-linux-gnu # doesn't need a release build since all that we want is the Rules dir
- name: create rules.zip
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'Rules.zip'
directory: 'addon/globalPlugins/MathCAT'
path: 'Rules'
- name: Upload Rules.zip
uses: actions/upload-artifact@v4
with:
name: 'Rules.zip'
path: 'addon/globalPlugins/MathCAT/Rules.zip'
compression-level: 0
retention-days: 1
rust-32:
name: Build 32 bit windows pyd file
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: 'x86'
- name: Build Rust Library
run: |
cargo build --target i686-pc-windows-msvc --release
- name: Setup Example dir
run: |
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
mv addon/globalPlugins/MathCAT/Rules Example
- name: test the build
run: |
cd Example
python test.py
- name: create zip file for pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_py-32-3.11-win.zip'
directory: 'Example'
path: 'libmathcat_py.pyd'
- name: Upload 32 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_py-32-3.11-win.zip
path: libmathcat_py-32-3.11-win.zip
compression-level: 0
retention-days: 1
rust-64:
name: Build 64 bit windows pyd file
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: 'x64'
- name: Build Rust Library
run: |
cargo build --target x86_64-pc-windows-msvc --release
- name: Setup Example dir
run: |
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
mv addon/globalPlugins/MathCAT/Rules Example
- name: create zip file for pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_py-64-3.11-win.zip'
directory: 'Example'
path: 'libmathcat_py.pyd'
- name: test the build
run: |
cd Example
python test.py
- name: Upload 64 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_py-64-3.11-win.zip
path: libmathcat_py-64-3.11-win.zip
compression-level: 0
retention-days: 1
linux-64:
name: Build linux pyd file (64-bit intel)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
architecture: 'x64'
- name: Build Rust Library
run: |
cargo build --target x86_64-unknown-linux-gnu --release
- name: Setup Example dir
run: |
# don't know why it is "liblib...". For consistancy with other versions, it is renamed.
cp target/x86_64-unknown-linux-gnu/release/liblibmathcat_py.so Example/libmathcat_py.so
cp -r addon/globalPlugins/MathCAT/Rules Example
- name: test build
run: |
cd Example
python test.py
- name: create zip file for pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_py-64-3.11-linux.zip'
directory: 'Example'
path: 'libmathcat_py.so'
- name: Upload 64 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_py-64-3.11-linux.zip
path: libmathcat_py-64-3.11-linux.zip
compression-level: 0
retention-days: 1
build-addon:
name: build-addon
continue-on-error: false
needs: [l10n, zip-rules, rust-32]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# download the 32 build
- name: Download 32 bit build
uses: actions/download-artifact@v4
with:
name: libmathcat_py-32-3.11-win.zip
# download the Rules dir (not part of checkout)
- name: Download 32 bit build
uses: actions/download-artifact@v4
with:
name: Rules.zip
# put things where they belong
- name: Set up addons dir
run: |
unzip libmathcat_py-32-3.11-win.zip
mv libmathcat_py.pyd Rules.zip addon/globalPlugins/MathCAT
cd addon/globalPlugins/MathCAT
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place MathCATgui.py # fix wx file
unzip Rules.zip
rm Rules.zip
# build the addon
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11 # needed for scons
- name: Install scons dependencies
run: |
pip install scons markdown
sudo apt update
sudo apt install gettext
- name: Run scons to build .addon file
run: |
scons
- name: Upload the addon
uses: actions/upload-artifact@v4
with:
name: addon
path: "*.nvda-addon"
compression-level: 0
retention-days: 1
pre-release:
name: Pre Release
continue-on-error: false
needs: [zip-rules, rust-32, rust-64, linux-64, build-addon]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# download the previous build artifacts and put them in their proper places
- name: Download Rules.zip
uses: actions/download-artifact@v4
with:
name: Rules.zip
- name: Download 32 bit build
uses: actions/download-artifact@v4
with:
name: libmathcat_py-32-3.11-win.zip
- name: Download 64 bit build
uses: actions/download-artifact@v4
with:
name: libmathcat_py-64-3.11-win.zip
- name: Download 64 bit linux build
uses: actions/download-artifact@v4
with:
name: libmathcat_py-64-3.11-linux.zip
- name: download the addon
uses: actions/download-artifact@v4
with:
name: addon
# put the files into the release
- name: Automatic release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
*.nvda-addon
libmathcat_py-32-3.11-win.zip
libmathcat_py-64-3.11-win.zip
libmathcat_py-64-3.11-linux.zip
Rules.zip