Skip to content

Build bluemonday.so using GOARCH to build an arm64 so #332

Build bluemonday.so using GOARCH to build an arm64 so

Build bluemonday.so using GOARCH to build an arm64 so #332

Workflow file for this run

name: Build wheels
on:
release:
types: [created, edited]
push:
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'
- name: Install Python dependencies
run: |
python -m pip install --upgrade -r development.txt
- name: Install Windows dependencies
if: runner.os == 'Windows'
run: |
choco install golang -f -y
choco install mingw -f -y
pip install --force cibuildwheel==2.3.1
go get -d
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
if: runner.os == 'Linux'
- name: Build Linux wheels and sdist
if: runner.os == 'Linux'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-musllinux_i686 *-musllinux_aarch64 *-musllinux_ppc64le *-musllinux_s390x *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python setup.py sdist
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build i686 wheel
if: runner.os == 'Linux'
env:
CIBW_ARCHS_LINUX: i686
CIBW_BUILD_VERBOSITY: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build ARM64 wheel
if: runner.os == 'Linux'
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD_VERBOSITY: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build x86_64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: x86_64
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build arm64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: arm64
GOARCH: arm64
CGO_ENABLED: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build Windows wheels
if: runner.os == 'Windows'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Publish sdist
if: runner.os == 'Linux'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine check ./dist/*.tar.gz
twine upload --skip-existing ./dist/*
- uses: actions/upload-artifact@v2
with:
path: |
./wheelhouse/*.whl
./dist/*.tar.gz
- name: Publish wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
if: ${{ github.event_name == 'release' && env.TWINE_USERNAME != null }}
run: |
twine check ./wheelhouse/*.whl
twine upload --skip-existing ./wheelhouse/*