Skip to content

A lightweight yet powerful audio-to-MIDI converter with pitch bend detection

Pypi workflow (#67)

Ziwei Ye86fc60dab06e
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..b59669d
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,56 @@
+name: publish
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ publish-tag:
+ name: Build and publish Python distributions to PyPI
+ runs-on: ubuntu-18.04
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v2
+
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: "3.10"
+
+ - name: Build source and wheel distributions
+ run: |
+ python -m pip install --upgrade build twine
+ python -m build
+ twine check --strict dist/*
+ - name: Publish distribution to PyPI
+ uses: pypa/gh-action-pypi-publish@master
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_API_TOKEN }}
+
+ - name: Create GitHub Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: ${{ github.ref }}
+ draft: false
+ prerelease: false
+
+ - name: Get Asset name
+ run: |
+ export PKG=$(ls dist/ | grep tar)
+ set -- $PKG
+ echo "name=$1" >> $GITHUB_ENV
+ - name: Upload Release Asset (sdist) to GitHub
+ id: upload-release-asset
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: dist/${{ env.name }}
+ asset_name: ${{ env.name }}
+ asset_content_type: application/zip