WIP on meson port #86
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
on: | |
push: | |
branches: [ master ] | |
tags: | |
- v* | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-13, windows-2019] | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Install PCRE2 (Windows only) | |
if: matrix.os == 'windows-2019' | |
run: | | |
Set-ExecutionPolicy Bypass -Scope Process -Force | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install pcre2 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_SKIP: cp27-* cp35-* pp* *musl* "*-macosx_arm64" | |
CIBW_ARCHS_LINUX: "auto64" | |
CIBW_ARCHS_MACOS: "x86_64" | |
CIBW_BEFORE_ALL_LINUX: "which yum && yum install -y pcre2-devel zlib-devel" | |
CIBW_TEST_REQUIRES: pytest | |
CIBW_TEST_COMMAND: "pytest -v {package}/tests" | |
# # Uncomment to get SSH access for testing | |
# - name: Setup tmate session | |
# if: failure() | |
# uses: mxschmitt/action-tmate@v3 | |
# timeout-minutes: 15 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
- name: Release wheels | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: wheelhouse/*.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check tag | |
id: check-tag | |
run: | | |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo ::set-output name=match::true | |
fi | |
- name: Deploy to PyPI | |
if: steps.check-tag.outputs.match == 'true' | |
run: | | |
pip3 install twine | |
python3 -m twine upload wheelhouse/*.whl | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} |