Skip to content

Commit b79503e

Browse files
committed
Put on Pypi
1 parent 73c123f commit b79503e

File tree

8 files changed

+36
-7
lines changed

8 files changed

+36
-7
lines changed

.github/workflows/generate-vicutils-docs.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generate VicUtils Docs
1+
name: Generate VicUtils Docs and Publish
22

33
on:
44
push:
@@ -9,6 +9,7 @@ on:
99

1010
permissions:
1111
contents: write
12+
id-token: write # Required for trusted publishing
1213

1314
jobs:
1415
generate-docs:
@@ -25,9 +26,9 @@ jobs:
2526
with:
2627
python-version: '3.x'
2728

28-
- name: Install pdoc
29+
- name: Install dependencies
2930
run: |
30-
pip install pdoc3
31+
pip install pdoc3 build twine
3132
echo "pdoc3 version:"
3233
pdoc --version
3334
@@ -61,6 +62,9 @@ jobs:
6162
cat .version
6263
echo "setup.py:"
6364
grep 'version=' setup.py
65+
66+
# Export for later steps
67+
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
6468
6569
- name: Check vicutils directory
6670
run: |
@@ -91,6 +95,20 @@ jobs:
9195
echo "=== Final vicutils contents ==="
9296
ls -la vicutils/
9397
98+
- name: Build package
99+
run: |
100+
echo "=== Building package ==="
101+
python -m build
102+
echo "=== Build artifacts ==="
103+
ls -la dist/
104+
105+
- name: Publish to PyPI
106+
env:
107+
TWINE_USERNAME: __token__
108+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
109+
run: |
110+
python -m twine upload dist/* --skip-existing
111+
94112
- name: Commit and push if changes
95113
run: |
96114
git config --local user.name "Vic-Nas"
@@ -103,8 +121,7 @@ jobs:
103121
if git diff --staged --quiet; then
104122
echo "No changes to commit"
105123
else
106-
new_version=$(cat .version)
107-
echo "Committing changes for version $new_version"
108-
git commit -m "Auto-generate docs and bump version to $new_version [skip ci]"
124+
echo "Committing changes for version $NEW_VERSION"
125+
git commit -m "Auto-generate docs and bump version to $NEW_VERSION [skip ci]"
109126
git push
110127
fi

dist/vicutils-0.3-py3-none-any.whl

3.53 KB
Binary file not shown.

dist/vicutils-0.3.tar.gz

3.58 KB
Binary file not shown.

vicutils.egg-info/PKG-INFO

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Metadata-Version: 2.4
2+
Name: vicutils
3+
Version: 0.3

vicutils.egg-info/SOURCES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
README.md
2+
setup.py
3+
vicutils/__init__.py
4+
vicutils/printBin.py
5+
vicutils.egg-info/PKG-INFO
6+
vicutils.egg-info/SOURCES.txt
7+
vicutils.egg-info/dependency_links.txt
8+
vicutils.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

vicutils.egg-info/top_level.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vicutils

vicutils/printBin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
DEFAULT_UNIT_SIZE = 3
66
DEFAULT_FILL_CHAR = " "
77

8-
98
class BinaryNode:
109
"""
1110
Represents a node in a binary tree.

0 commit comments

Comments
 (0)