Skip to content

Merge pull request #8 from odigos-io/switch-twine-to-use-username-pas… #3

Merge pull request #8 from odigos-io/switch-twine-to-use-username-pas…

Merge pull request #8 from odigos-io/switch-twine-to-use-username-pas… #3

Workflow file for this run

name: Publish Python Package
on:
push:
tags:
- 'v*' # Trigger on version tags
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Update version based on tag
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/}
sed -i "s/version=.*/version='${VERSION_TAG}',/" setup.py
- name: Build the package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*