Build main by @liyaka #7
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
name: "Build and Publish" | |
run-name: "Build ${{ github.ref_name }} by @${{ github.actor }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: Version | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
submodules: true | |
fetch-tags: true | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.9 | |
- name: Build pip package | |
run: | | |
pip3 install -U pip build | |
export VERSION="${{inputs.version}}" | |
python3 -m build --sdist --wheel --outdir dist/ . | |
- name: Create git tag | |
run: | | |
set -x | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git tag ${{inputs.version}} | |
git push --no-verify origin ${{inputs.version}} | |
- name: Publish package distributions to PyPI | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: dist |