File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Automatically publish to PyPI when a GitHub release is published
2+ name : Publish to PyPI
3+
4+ # Run this action when a release is published
5+ on : # yamllint disable-line rule:truthy
6+ release :
7+ types : [published]
8+
9+ # Updates version.txt, builds, and pushes to PyPI
10+ jobs :
11+ release :
12+ name : Builds and publishes to PyPI
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v2
16+ with :
17+ ref : main
18+ - uses : actions/setup-python@v2
19+ - uses : battila7/get-version-action@v2
20+ - name : Update version.txt
21+ run : |
22+ echo ${{ steps.get_version.outputs.version-without-v }} > speechbrain/version.txt
23+ git config user.name github-actions
24+ git config user.email [email protected] 25+ git add speechbrain/version.txt
26+ git commit -m 'Auto-update version.txt'
27+ git push
28+ - name : Install pypa/build
29+ run : python -m pip install build --user
30+ - name : Build binary wheel and source tarball
31+ run : python -m build --sdist --wheel --outdir dist/
32+ - name : Publish to PyPI
33+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
34+ uses : pypa/gh-action-pypi-publish@release/v1
35+ with :
36+ password : ${{ secrets.PYPI_API_KEY }}
You can’t perform that action at this time.
0 commit comments