Skip to content

Prepare 0.1.5 release #6

Prepare 0.1.5 release

Prepare 0.1.5 release #6

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- 'v*'
permissions:
deployments: write
packages: write
repository-projects: read
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
# Build the distribution
- name: Build distribution
run: |
# Extract the tag from github.ref (e.g., refs/tags/v1.2.3)
CURRENT_TAG="${{ github.ref }}"
VERSION=${CURRENT_TAG#refs/tags/v} # Remove 'refs/tags/v' from the tag
sed -i "s/version=\"[^\"]*\"/version=\"$VERSION\"/" setup.py
python setup.py sdist bdist_wheel
# Upload the distribution to PyPI
- name: Upload to PyPI
run: |
twine upload dist/*