fix build.yml #54
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: Test wheel build without pypi upload | |
# Build on every branch push, tag push, and pull request change: | |
#on: [push] | |
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
on: | |
push: | |
branches: | |
- testing | |
- fix_ci | |
jobs: | |
build_wheels: | |
name: Build distribution on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v3 | |
name: Install Python | |
with: | |
python-version: 3.9 | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==2.16.2 | |
- name: Build wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-sdist | |
path: dist/*.tar.gz | |
upload_pypi: | |
name: upload to TestPyPi | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
environment: testpypi | |
permissions: | |
id-token: write | |
# upload to PyPI on every tag starting with 'v' | |
#if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist/ | |
- name: Display structure of downloaded files | |
run: ls -R dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
packages-dir: dist/* |