Refactor release.yaml workflow: Update build matrix and dependencies #1
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] | |
python-version: ['3.10', '3.11', '3.12'] | |
platform: ['x86_64', 'arm64', 'win64'] | |
acceleration: ['cpu', 'cuda', 'hipblas', 'vulkan'] | |
exclude: | |
- os: windows-latest | |
platform: arm64 | |
- os: windows-latest | |
platform: x86_64 | |
- os: macos-latest | |
acceleration: cuda | |
- os: macos-latest | |
acceleration: hipblas | |
- os: macos-latest | |
acceleration: vulkan | |
- os: macos-latest | |
platform: win64 | |
- os: ubuntu-latest | |
platform: win64 | |
- os: ubuntu-latest | |
platform: arm64 | |
- os: ubuntu-latest | |
acceleration: cuda | |
- os: ubuntu-latest | |
acceleration: hipblas | |
- os: ubuntu-latest | |
acceleration: vulkan | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install numpy cmake wheel setuptools build | |
- name: Build wheel | |
env: | |
SIMPLER_WHISPER_ACCELERATION: ${{ matrix.acceleration }} | |
SIMPLER_WHISPER_PLATFORM: ${{ matrix.platform }} | |
run: | | |
python setup.py build_ext --inplace | |
python -m build --wheel | |
- name: Set wheel name | |
shell: pwsh | |
run: | | |
$wheelName = "wheel-${{ matrix.os }}-${{ matrix.platform }}-py${{ matrix.python-version }}" | |
if ("${{ matrix.acceleration }}" -ne "") { | |
$wheelName += "-${{ matrix.acceleration }}" | |
} | |
echo "WHEEL_NAME=$wheelName" >> $env:GITHUB_ENV | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.WHEEL_NAME }} | |
path: dist/*.whl | |
create_release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build source distribution | |
run: python -m build --sdist | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
files: | | |
dist/*.tar.gz | |
*/*.whl |