Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
ci(release): attach Python packages automatically
LauraGPT94e07f85da90
diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.ymlindex 67fbc3c5f..92edbfd14 100644--- a/.github/workflows/release-on-tag.yml+++ b/.github/workflows/release-on-tag.yml@@ -15,6 +15,31 @@ jobs:- uses: actions/checkout@v4with:fetch-depth: 0+ - uses: actions/setup-python@v5+ with:+ python-version: "3.12"+ - name: Build and validate Python packages+ run: |+ set -euo pipefail+ VERSION="$(cat funasr/version.txt)"+ if [ "v${VERSION}" != "${{ github.ref_name }}" ]; then+ echo "Tag ${{ github.ref_name }} does not match funasr/version.txt (${VERSION})" >&2+ exit 1+ fi+ python -m pip install --upgrade build twine+ export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"+ python -m build+ SDIST="dist/funasr-${VERSION}.tar.gz"+ SDIST_ROOT="funasr-${VERSION}"+ SDIST_TMP="$(mktemp -d)"+ trap 'rm -rf "$SDIST_TMP"' EXIT+ tar -xzf "$SDIST" -C "$SDIST_TMP"+ tar --sort=name --mtime="@${SOURCE_DATE_EPOCH}" \+ --owner=0 --group=0 --numeric-owner \+ -C "$SDIST_TMP" -cf - "$SDIST_ROOT" \+ | gzip -n > "${SDIST}.reproducible"+ mv "${SDIST}.reproducible" "$SDIST"+ python -m twine check dist/*- name: Create GitHub Release with auto-generated notesenv:GH_TOKEN: ${{ github.token }}@@ -22,6 +47,14 @@ jobs:if ! gh release view "${{ github.ref_name }}" >/dev/null 2>&1; thengh release create "${{ github.ref_name }}" --generate-notes --verify-tag --title "${{ github.ref_name }}"fi+ - name: Add Python packages to GitHub Release+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ gh release upload "${{ github.ref_name }}" \+ dist/funasr-*.whl \+ dist/funasr-*.tar.gz \+ --clobber- name: Add Runtime assets and downloads to GitHub Releaseenv:GH_TOKEN: ${{ github.token }}diff --git a/tests/test_release_runtime_downloads.py b/tests/test_release_runtime_downloads.pyindex f29ecb8f8..629da1074 100644--- a/tests/test_release_runtime_downloads.py+++ b/tests/test_release_runtime_downloads.py@@ -116,6 +116,25 @@ def test_release_on_tag_workflow_uses_versioned_runtime_pointer():)+def test_release_on_tag_workflow_builds_and_uploads_python_packages():+ workflow = (ROOT / ".github" / "workflows" / "release-on-tag.yml").read_text(+ encoding="utf-8"+ )++ assert "python -m build" in workflow+ assert "python -m twine check dist/*" in workflow+ assert "SOURCE_DATE_EPOCH" in workflow+ assert "git log -1 --format=%ct" in workflow+ assert "tar --sort=name" in workflow+ assert 'gzip -n' in workflow+ assert "funasr/version.txt" in workflow+ assert "github.ref_name" in workflow+ assert "gh release upload" in workflow+ assert "dist/funasr-*.whl" in workflow+ assert "dist/funasr-*.tar.gz" in workflow+ assert "--clobber" in workflow++@pytest.mark.parametrize("mutation", ("missing", "unexpected"))def test_runtime_assets_rejects_non_exact_platform_matrix(mutation):module = load_release_script()