more devug #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish Wheels | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
- name: Build wheels | |
run: pip wheel . --wheel-dir wheelhouse | |
- name: List wheelhouse contents before uploading | |
run: ls -R wheelhouse | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheelhouse-${{ matrix.os }}-${{ matrix.python-version }} | |
path: wheelhouse/ | |
retention-days: 1 # Optional: Specify the number of days to retain the artifact | |
if-no-files-found: error | |
test_wheels: | |
runs-on: ubuntu-latest | |
needs: build_wheels | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11'] | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: List available artifacts | |
run: | | |
echo "Available artifacts:" | |
ls -1 /home/runner/work/ttsmms/ttsmms | |
- name: Download wheels for linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-ubuntu-latest-${{ matrix.python-version }} | |
path: wheelhouse | |
- name: Download wheels for windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-windows-latest-${{ matrix.python-version }} | |
path: wheelhouse | |
- name: Download wheels for macos | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-macos-latest-${{ matrix.python-version }} | |
path: wheelhouse | |
- name: List contents of wheelhouse after download | |
run: ls -R wheelhouse | |
- name: Install test dependencies | |
run: | | |
pip install pytest | |
pip install MarkupSafe | |
for wheel in wheelhouse/*/*/*.whl; do | |
package_name=$(basename "$wheel" | cut -d'-' -f1) | |
if ! python -c "import $package_name" &> /dev/null; then | |
echo "Installing $wheel" | |
pip install "$wheel" || pip install "$package_name" | |
else | |
echo "$package_name is already installed" | |
fi | |
done | |
- name: List files in the working directory | |
run: ls -R | |
- name: Run tests | |
run: pytest tests/ | |
publish_wheels: | |
runs-on: ubuntu-latest | |
needs: test_wheels | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: List available artifacts | |
run: | | |
echo "Available artifacts:" | |
ls -1 /home/runner/work/ttsmms/ttsmms | |
- name: Download wheels for linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-ubuntu-latest-3.10 | |
path: wheelhouse | |
- name: Download wheels for windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-windows-latest-3.10 | |
path: wheelhouse | |
- name: Download wheels for macos | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-macos-latest-3.10 | |
path: wheelhouse | |
- name: Download wheels for linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-ubuntu-latest-3.11 | |
path: wheelhouse | |
- name: Download wheels for windows | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-windows-latest-3.11 | |
path: wheelhouse | |
- name: Download wheels for macos | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse-macos-latest-3.11 | |
path: wheelhouse | |
- name: List contents of wheelhouse after download | |
run: ls -R wheelhouse | |
- name: Publish package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |