Skip to content

Enable eSpeak-NG on Windows #164

Enable eSpeak-NG on Windows

Enable eSpeak-NG on Windows #164

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created.
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [created] # Only publish on tagged releases
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx install pre-commit
- run: pre-commit install
- run: pre-commit run --all-files
test:
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
os: [windows-latest] # [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.13'] # ['3.9', '3.11', '3.13']
max-parallel: 9
runs-on: ${{ matrix.os }}
timeout-minutes: 10 # Save resources while our pytests are hanging
steps:
- if: runner.os == 'Linux'
run: sudo apt-get update -q -q && sudo apt-get install --yes espeak-ng libespeak1
- if: runner.os == 'macOS'
run: brew install espeak-ng
- name: Download and install eSpeak-NG
if: runner.os == 'Windows'
shell: pwsh
run: |
# Download the MSI file
Invoke-WebRequest -Uri "https://github.com/espeak-ng/espeak-ng/releases/download/1.51/espeak-ng-X64.msi" -OutFile "espeak-ng.msi"
# Install the MSI package silently
Start-Process msiexec.exe -ArgumentList '/i espeak-ng.msi /quiet /norestart' -Wait
$env:Path += ";$env:ProgramFiles\eSpeak NG"
dir "$env:ProgramFiles\eSpeak NG"
# $env:Path += ";$env:ProgramFiles\eSpeak NG;$env:ProgramFiles\eSpeak NG\espeak-ng.exe"
espeak-ng --version
#- if: runner.os == 'Windows'
# name: "Windows: Download and install eSpeak-NG"
# shell: pwsh
# run: |
# Invoke-WebRequest -Uri "https://github.com/espeak-ng/espeak-ng/archive/refs/tags/1.51.zip" -OutFile "espeak-ng.zip"
# Expand-Archive -Path "espeak-ng.zip" -DestinationPath "$env:ProgramFiles\espeak-ng"
# $env:Path += ";$env:ProgramFiles\espeak-ng"
#- if: runner.os == 'Windows'
# name: "Windows: Download, install, and verify eSpeak-NG"
# shell: pwsh
# run: |
# Invoke-WebRequest -Uri "https://github.com/espeak-ng/espeak-ng/archive/refs/tags/1.51.zip" -OutFile "espeak-ng.zip"
# Expand-Archive -Path "espeak-ng.zip" -DestinationPath "$env:ProgramFiles"
# $env:Path += ";$env:ProgramFiles\espeak-ng-1.51;$env:ProgramFiles\espeak-ng-1.51\espeak-ng"
# dir "$env:ProgramFiles\espeak-ng-1.51"
# ls "$env:ProgramFiles\espeak-ng-1.51"
# # .\espeak-ng --version # Direct path to run the executable
# - run: "C:\Program Files\eSpeak NG\espeak-ng.exe" --version || espeak-ng --version
- run: PATH="C:\ProgramFiles\eSpeak NG:$PATH" espeak-ng --version
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install pytest pytest-timeout
pip install --editable .
- run: pytest -s -vvv --strict --timeout=600
build:
runs-on: ubuntu-latest
needs: [test] # This ensures tests pass before build
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install build twine
- name: Clean previous builds
run: |
rm -rf dist
- name: Build package
run: |
python -m build
python -m twine check --strict dist/*
deploy:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created' # Only on release creation
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}