Skip to content

Commit ca26f67

Browse files
committed
Added initial pyproject.toml and .github workflow for it
1 parent 97e8f6a commit ca26f67

2 files changed

Lines changed: 97 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Publish Python distribution to PyPI and TestPyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.x"
22+
23+
- name: Install build dependencies
24+
run: python -m pip install --upgrade pip build
25+
26+
- name: Build package
27+
run: python -m build
28+
29+
- name: Store the distribution packages
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: python-package-distributions
33+
path: dist/
34+
35+
publish-to-testpypi:
36+
name: Publish Python distribution to TestPyPI
37+
needs:
38+
- build
39+
runs-on: ubuntu-latest
40+
41+
environment:
42+
name: testpypi
43+
url: https://test.pypi.org/p/Python-Lua-Helper
44+
45+
permissions:
46+
id-token: write
47+
48+
steps:
49+
- name: Download all the dists
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
55+
- name: Publish distribution to TestPyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
repository-url: https://test.pypi.org/legacy/
59+
60+
publish-to-pypi:
61+
name: Publish Python distribution to PyPI
62+
if: startsWith(github.ref, 'refs/tags/')
63+
needs:
64+
- build
65+
runs-on: ubuntu-latest
66+
67+
environment:
68+
name: pypi
69+
url: https://pypi.org/p/Python-Lua-Helper
70+
71+
permissions:
72+
id-token: write
73+
74+
steps:
75+
- name: Download all the dists
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: python-package-distributions
79+
path: dist/
80+
81+
- name: Publish distribution to PyPI
82+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "Python-Lua-Helper"
7+
version = "0.1.0"
8+
description = "Lua configuration system for your Python projects."
9+
authors = [
10+
{name = "DarkCaster", email = "dark.caster@outlook.com"}
11+
]
12+
dependencies = []
13+
14+
[project.optional-dependencies]
15+
dev = [ "pytest" ]

0 commit comments

Comments
 (0)