Skip to content

Commit ea901db

Browse files
committed
add CI for pypi
1 parent d478983 commit ea901db

3 files changed

Lines changed: 81 additions & 2 deletions

File tree

.github/workflows/publish.yaml

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

comiclib/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def info():
504504
return {
505505
"name": "ComicLib",
506506
"motd": "Welcome to the library powered by ComicLib!",
507-
"version": "0.0.1.dev1",
507+
"version": "0.0.1.dev2",
508508
"version_name": "Kaosu",
509509
"version_desc": "Ababababa",
510510
"total_pages_read": "0",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "comiclib"
7-
version = "0.0.1.dev1"
7+
version = "0.0.1.dev2"
88
authors = [
99
{ name="URenko" },
1010
]

0 commit comments

Comments
 (0)