Create Release & Upload To PyPI #14
Workflow file for this run
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: Create Release & Upload To PyPI | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- v?[0-9]+.[0-9]+.[0-9]+ # add .* to allow dev releases | |
jobs: | |
build: | |
name: Plette PyPI Upload | |
runs-on: ubuntu-latest | |
env: | |
CI: "1" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install latest tools for build | |
run: | | |
python -m pip install build twine invoke . | |
- name: Build wheels | |
run: | | |
python -m build | |
- name: Upload to PyPI via Twine | |
# to upload to test pypi, pass --repository-url https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN | |
run: | | |
twine upload --verbose -u '__token__' -p '${{ secrets.PYPI_TOKEN }}' dist/* |