-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acbae57
commit 3377901
Showing
1 changed file
with
94 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: ["*.*.*"] | ||
paths-ignore: | ||
- "**.md" | ||
- "**.png" | ||
- "**.jpg" | ||
- "**.gif" | ||
|
||
jobs: | ||
linux-macos: | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
os: [linux, darwin] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout code | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache/pypoetry/artifacts | ||
~/.cache/pypoetry/repository | ||
~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-poetry-${{ matrix.python-version }}- | ||
- name: Run CI build | ||
run: | | ||
make ci | ||
env: | ||
BUILD_OS: ${{ matrix.os }} | ||
|
||
- name: Upload wheel as artifact | ||
if: matrix.python-version == '3.11' && matrix.os == 'linux' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: speech-dist | ||
path: dist/*.whl | ||
retention-days: 5 | ||
|
||
- name: Release GitHub Assets | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux' | ||
with: | ||
# Draft for official releases to prepare and review release notes before publishing | ||
draft: ${{ !contains(github.ref, 'rc') }} | ||
fail_on_unmatched_files: true | ||
prerelease: ${{ contains(github.ref, 'rc') }} | ||
files: dist/*.whl | ||
|
||
- name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == '3.11' && matrix.os == 'linux' | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.CI_PYPI_API_TOKEN }} | ||
PUBLISH_SOURCE: ${{ matrix.os == 'linux' && '1' || '' }} | ||
run: | | ||
make publish-pypi | ||
windows-amd64: | ||
timeout-minutes: 20 | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout code | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: CI | ||
shell: powershell | ||
run: | | ||
make ci |