Skip to content

Publish pypi

Publish pypi #11

Workflow file for this run

name: Publish pypi
on:
workflow_dispatch:
jobs:
publish:
name: ${{ matrix.archive }}
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # macOS arm64
archive: "espeak-ng-libs-macos-arm64.tar.gz"
wheel-tag: "py3-none-macosx_11_0_arm64"
- platform: "macos-latest" # macOS x86-64
archive: "espeak-ng-libs-linux-x86_64.tar.gz"
wheel-tag: "py3-none-macosx_10_12_x86_64"
- platform: "ubuntu-22.04" # Linux x86_64
archive: "espeak-ng-libs-linux-x86_64.tar.gz"
wheel-tag: "py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64"
- platform: "windows-latest" # Windows x86_64
archive: "espeak-ng-libs-windows-x86_64.tar.gz"
wheel-tag: "py3-none-win_amd64"
- platform: "ubuntu-22.04" # Linux aarch64
archive: "espeak-ng-libs-linux-arm64.tar.gz"
wheel-tag: "py3-none-manylinux_2_28_aarch64"
# - platform: "windows-latest" # Windows aarch64
# archive: "libaec-win-aarch64.tar.gz"
# wheel-tag: "py3-none-win_arm64"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Prepare libraries in package
run: |
# Download the archive
curl -LO https://github.com/thewh1teagle/espeakng-loader/releases/latest/download/${{ matrix.archive }}
tar xf "${{ matrix.archive }}"
# Copy appropriate shared libraries to the target directory
extracted_dir="espeak-ng-libs"
# Preserve symbolic links
find -L "$extracted_dir" -type f \( -name "*.dll*" -o -name "*.dylib*" -o -name "*.so*" \) -exec cp -P {} src/espeakng_loader/ \;
# Show the contents of the package
echo "Package contents:"
ls -l src/espeakng_loader/
shell: bash
- name: Build and publish
run: |
uv build
# prevent duplicate
rm -f dist/*.tar.gz
uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
WHEEL_TAG: ${{ matrix.wheel-tag }}
shell: bash