Skip to content

Commit

Permalink
Create python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmerk authored Sep 27, 2024
1 parent 9bd1355 commit a4e52a5
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Python Package

on:
push:
tags:
- 'v*' # Only trigger on tag pushes like v1.0.0

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Specify your Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a4e52a5

Please sign in to comment.