v0.5.0 #20
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: Upload PyPi Release | |
on: | |
release: | |
types: [published] | |
env: | |
PYTHON_VERSION: '3.7.17' | |
jobs: | |
build: | |
name: Build package | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
strategy: | |
matrix: | |
python-version: [ "3.11" ] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set VERSION variable from tag | |
run: | | |
VERSION=${{github.head_ref}} | |
echo "VERSION=${VERSION##*/}" >> $GITHUB_ENV | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pypa/build | |
run: | | |
python -m pip install build | |
python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: dist/ | |
publish: | |
name: Publish on PyPi | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
needs: build | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download built artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: package | |
path: dist | |
- name: Publish on PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |