Skip to content

Commit 90ad68d

Browse files
committed
gha to pypi publishing
1 parent 09d7611 commit 90ad68d

File tree

3 files changed

+47
-18
lines changed

3 files changed

+47
-18
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow builds and publishes the package to PyPI when a tag is pushed
2+
3+
name: Publish Python Package
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*' # Trigger on tags starting with 'v'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
# Grant GITHUB_TOKEN the permissions required to create a release
15+
permissions:
16+
contents: read
17+
id-token: write # Required for trusted publishing
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x' # Use a recent Python version for building
26+
27+
- name: Install build dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install build twine
31+
32+
- name: Build package
33+
run: python -m build
34+
35+
- name: Publish package to PyPI
36+
uses: pypa/gh-action-pypi-publish@release/v1
37+
# No API token needed if using trusted publishing
38+
# with:
39+
# password: ${{ secrets.PYPI_API_TOKEN }} # Use an API Token if not using Trusted Publishing
40+
41+
# Optional: Create a GitHub Release
42+
# - name: Create GitHub Release
43+
# uses: softprops/action-gh-release@v1
44+
# with:
45+
# files: dist/*
46+
# env:
47+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)