Skip to content

Commit

Permalink
Release wheels for macOS M1, win32, and linux aarch64 (#32)
Browse files Browse the repository at this point in the history
* Release wheels for macOS M1, win32, and linux aarch64

* small fixes
  • Loading branch information
csukuangfj committed Sep 4, 2023
1 parent d2fff41 commit 5f4373e
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 5 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build-wheels-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build-wheels-aarch64

on:
push:
branches:
- wheel
tags:
- '*'

workflow_dispatch:

concurrency:
group: build-wheels-aarch64-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels_aarch64:
name: Build wheels for aarch64 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686"
CIBW_BUILD_VERBOSITY: 3
CIBW_ARCHS_LINUX: aarch64

- name: Display wheels
shell: bash
run: |
ls -lh ./wheelhouse/
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
twine upload ./wheelhouse/*.whl
57 changes: 57 additions & 0 deletions .github/workflows/build-wheels-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: build-wheels-macos

on:
push:
branches:
- wheel
tags:
- '*'

workflow_dispatch:

concurrency:
group: build-wheels-macos-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]

steps:
- uses: actions/checkout@v2

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_ENVIRONMENT: KALDILM_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'"
CIBW_ARCHS: "universal2"
CIBW_BUILD_VERBOSITY: 3

# Don't repair macOS wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""

- name: Display wheels
shell: bash
run: |
ls -lh ./wheelhouse/
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
twine upload ./wheelhouse/*.whl
54 changes: 54 additions & 0 deletions .github/workflows/build-wheels-win32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build-wheels-win32

on:
push:
branches:
- wheel
tags:
- '*'

workflow_dispatch:

concurrency:
group: build-wheels-win32-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels_win32:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v2

# see https://cibuildwheel.readthedocs.io/en/stable/changelog/
# for a list of versions
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
CIBW_ENVIRONMENT: KALDILM_CMAKE_ARGS="-A Win32"
CIBW_SKIP: "*-win_amd64"
CIBW_BUILD_VERBOSITY: 3

- name: Display wheels
shell: bash
run: |
ls -lh ./wheelhouse/
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
twine upload ./wheelhouse/*.whl
21 changes: 18 additions & 3 deletions .github/workflows/build-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
tags:
- '*'

workflow_dispatch:

concurrency:
group: build-wheels-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -18,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -36,8 +38,6 @@ jobs:
run: |
ls -lh ./wheelhouse/
ls -lh ./wheelhouse/*.whl
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Expand All @@ -51,3 +51,18 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install wheel twine setuptools
twine upload ./wheelhouse/*.whl
- name: Build sdist
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
python3 setup.py sdist
ls -lh dist/*
- name: Publish sdist to PyPI
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/kaldilm-*.tar.gz
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(kaldilm)

# also change scripts/conda/kaldilm/meta.yml
set(kaldilm_VERSION "1.15")
set(kaldilm_VERSION "1.15.1")

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
Expand Down
2 changes: 1 addition & 1 deletion scripts/conda/kaldilm/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

package:
name: kaldilm
version: "1.15"
version: "1.15.1"

source:
path: "{{ environ.get('KALDILM_ROOT_DIR') }}"
Expand Down

0 comments on commit 5f4373e

Please sign in to comment.