Skip to content

Commit

Permalink
Wheel builds only by pypa/cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Sep 1, 2022
1 parent be3eca7 commit 8408825
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 167 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/pypi-wheel-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Spglib PyPI Wheel builds for linux

on:
push:
branches:
- rc
- master

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: auto aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
with:
package-dir: python
output-dir: wheelhouse
config-file: "{package}/pyproject.toml"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: |
pip install numpy
cd python
sh pre-build-script.sh
python setup.py sdist
cd ..
- uses: actions/upload-artifact@v3
with:
path: python/dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Publish package to TestPyPI
if: startsWith(github.ref, 'refs/heads/rc')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/heads/master')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
84 changes: 0 additions & 84 deletions .github/workflows/pypi-wheels-win-mac.yml

This file was deleted.

83 changes: 0 additions & 83 deletions .github/workflows/pypi-wheels.yml

This file was deleted.

0 comments on commit 8408825

Please sign in to comment.