Skip to content

Commit 2e90cdc

Browse files
committed
2 parents 29d3c57 + 299d169 commit 2e90cdc

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/python-publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish Python Package
10+
11+
on:
12+
push:
13+
tags:
14+
- "v0.1.0
15+
16+
jobs:
17+
build-n-publish:
18+
runs-on: ubuntu-latest
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'
26+
27+
- name: Install build dependencies
28+
run: python -m pip install --upgrade pip setuptools wheel build twine
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Verify package
34+
run: twine check dist/*
35+
36+
- name: Publish to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}
40+
41+
- name: Create GitHub Release
42+
uses: softprops/action-gh-release@v1
43+
with:
44+
files: dist/*
45+
generate_release_notes: true
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)