Add template files

This commit is contained in:
2024-05-19 22:54:33 +08:00
parent 10878d035f
commit 9516c5b0d1
3 changed files with 53 additions and 1 deletions

32
.github/workflows/python-publish.yml vendored Executable file
View File

@@ -0,0 +1,32 @@
name: Release and Publish Python Package
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
- name: Build package
run: |
python3 -m build --sdist --wheel --outdir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
dist/*

View File

@@ -1,2 +1,3 @@
# python-package-template # python-package-template
A template for Python project to be published on PyPI with setuptools, python-build, PyPI trusted publisher and github actions auto release.
A template for Python project to be published on PyPI with setuptools, python-build, PyPI trusted publishing and github actions auto release.

19
pyproject.toml Normal file
View File

@@ -0,0 +1,19 @@
[project]
# name = "Project name..."
# version = "Project version, e.g. 0.0.1"
# description = "Project description..."
# authors = [
# {name = "Author name", email = "Author email"},
# ...
# ]
# license = {text = "Project license on PyPI, e.g. MIT"}
# dependencies = ["dependency1...", "dependency2...", ...]
# requires-python = ">=3.9"
readme = "README.md"
[project.urls]
# Homepage = "https://github.com/..."
# Repository = "https://github.com/..."
[tool.pyright]
pythonVersion = "3.9"