-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from supermihi/use-cibuildwheel
CI: use cibuildwheel
- Loading branch information
Showing
22 changed files
with
473 additions
and
385 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,74 @@ | ||
name: Python package | ||
name: build & test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10"] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
TAGLIB_HOME: taglib-install | ||
PYTAGLIB_CYTHONIZE: 1 | ||
CIBW_SKIP: "pp*-win* *p36-*" # skip until https://github.com/supermihi/pytaglib/issues/110 is resolved | ||
CIBW_ARCHS: auto64 | ||
CIBW_ARCHS_MACOS: "x86_64 arm64" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: cache built taglib on windows | ||
uses: actions/cache@v2 | ||
python-version: "3.x" | ||
- name: cache built taglib on windows (very slow) | ||
uses: actions/cache@v3 | ||
if: ${{ runner.os == 'Windows' }} | ||
with: | ||
path: ${{ env.TAGLIB_HOME }} | ||
# renew the cache when how taglib is built changes (e.g. version update) | ||
key: taglib-install-windows-${{ hashFiles('build_taglib_windows.py') }} | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- name: build TagLib (Windows) | ||
if: ${{ runner.os == 'Windows' }} | ||
run: python build_taglib_windows.py --install-dest=$Env:TAGLIB_HOME | ||
- name: Install TagLib (Unix) | ||
if: ${{ runner.os != 'Windows' }} | ||
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y libtag1-dev ; else brew install taglib ; fi | ||
- name: install pip dependencies | ||
path: build/taglib | ||
key: taglib-windows-${{ hashFiles('build_taglib.py') }} | ||
- name: Install TagLib (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
run: sudo apt-get install -y libtag1-dev | ||
- name: install pip dependencies (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest Cython wheel | ||
- name: Build | ||
run: python setup.py build install | ||
- name: sdist | ||
- name: sdist (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
run: python setup.py sdist | ||
- name: bdist | ||
if: ${{ runner.os == 'Windows' }} | ||
run: python setup.py bdist_wheel | ||
- name: Test with pytest | ||
run: pytest | ||
- name: upload sdist | ||
uses: actions/upload-artifact@v2 | ||
- name: upload sdist (Linux) | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ runner.os == 'Linux' }} | ||
with: | ||
name: dist | ||
name: sdist | ||
path: dist | ||
retention-days: 5 | ||
- name: upload wheel | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ runner.os == 'Windows' }} | ||
- name: build binary wheels | ||
uses: pypa/[email protected] | ||
- name: upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
name: bdist | ||
path: ./wheelhouse/*.whl | ||
retention-days: 5 | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
steps: | ||
- name: download package artifacts | ||
uses: actions/download-artifact@v2 | ||
- name: download source wheel | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
name: sdist | ||
path: wheels | ||
- name: download binary wheels | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: bdist | ||
path: wheels | ||
- name: publish package pypi.org | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip_existing: true | ||
packages-dir: wheels |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ dist | |
.eggs | ||
.vscode | ||
/src/taglib.cpp | ||
wheelhouse |
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
Oops, something went wrong.