Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Python Lint

on:
push:
pull_request:
paths:
- '**/*.py'

jobs:
pyright:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Set up Node.js (for pyright)
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Run packaging script
run: bash ./package.sh
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Windows Build & Pyright Check

on:
pull_request:
branches:
- main
paths:
- '**/*.py'

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up Node.js (for pyright)
uses: actions/setup-node@v5
with:
# use the latest Node.js available on the runner/tool-cache
node-version: 'latest'

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

- name: Install pyright
run: npm install -g pyright

- name: Run Pyright type check
run: pyright **/*.py

- name: Install PyInstaller (latest)
run: |
python -m pip install --upgrade pip
pip install pyinstaller

- name: Build Windows executables
run: ./win-build.cmd

- name: Upload build artifacts for debugging
uses: actions/upload-artifact@v4
with:
name: windows-executables
path: |
*.exe
45 changes: 45 additions & 0 deletions .github/workflows/windows-commit-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Commit Windows executables on merge

on:
workflow_run:
workflows: ["Windows Build & Pyright Check"]
types:
- completed

jobs:
commit-executables:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Checkout main branch
uses: actions/checkout@v5
with:
ref: main

- name: Try to download artifact
id: download
uses: actions/download-artifact@v4
with:
name: windows-executables
path: temp_exe
continue-on-error: true

- name: Check if artifact exists
run: |
if [ ! -d "temp_exe" ] || [ -z "$(ls -A temp_exe)" ]; then
echo "No artifact found. Exiting workflow."
exit 0
fi

- name: Copy executables to repo root
run: |
cp temp_exe/*.exe ./

- name: Commit and push updated .exe files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add *.exe
git diff --quiet && echo "No changes to commit" || git commit -m "Update Windows executables from latest merged PR"
git push origin main
1 change: 1 addition & 0 deletions gettools.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
THE SOFTWARE.
"""


from __future__ import print_function
import os
import sys
Expand Down