Skip to content

v0.0.7

v0.0.7 #3

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Update version
run: |
# Get version from release tag
VERSION=${GITHUB_REF#refs/tags/v}
# Update version in __init__.py
sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" meloplus/__init__.py
# Commit the version update
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update version to ${VERSION}" -a
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*