Skip to content

Merge pull request #4 from Redmomn/dev #6

Merge pull request #4 from Redmomn/dev

Merge pull request #4 from Redmomn/dev #6

name: Release
on:
push:
tags:
- v*
jobs:
publish-pypi-github:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/nonebot-plugin-vits-tts
permissions:
id-token: write
# IMPORTANT: this permission is mandatory for trusted publishing
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Setup Python environment
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install pypa/build
run: |
python -m pip install build --user
- run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- uses: release-drafter/release-drafter@v5
with:
name: Release ${{ env.TAG_NAME }}
tag: ${{ env.TAG_NAME }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
ls dist/
- name: Publish Github
run: |
gh release upload --clobber ${{ env.TAG_NAME }} dist/*.tar.gz dist/*.whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish pypi
uses: pypa/gh-action-pypi-publish@release/v1