Skip to content

Commit 8d817a5

Browse files
committed
chore: add release workflow for automated versioning and package uploads
1 parent a80f7ab commit 8d817a5

4 files changed

Lines changed: 45 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
branches:
8+
- main
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install dependencies
24+
run: |
25+
pip install uv
26+
make install
27+
28+
- name: Build package
29+
run: make build
30+
31+
- name: Upload to TestPyPI
32+
run: make upload
33+
env:
34+
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
35+
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
36+
37+
- name: Upload to PyPI
38+
run: make prod-upload
39+
env:
40+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
41+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ build: clean
2727

2828
# NOTE: check ~/.pypirc is configured correctly
2929
upload:
30-
twine upload --verbose --repository testpypi dist/*
30+
uv run twine upload --verbose --repository testpypi dist/*
3131

3232
prod-upload:
33-
twine upload --verbose --repository pypi dist/*
33+
uv run twine upload --verbose --repository pypi dist/*
3434

3535
clean:
3636
rm -rf dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python-code-splitter
22

3-
A script to split Python code by classes and functions.
3+
A tool to split Python code by classes and functions.
44

55
## Install
66

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages = ["src/"]
77

88
[project]
99
name = "python-code-splitter"
10-
version = "0.1.3"
10+
version = "0.1.4"
1111
requires-python = ">=3.9"
1212
description = "split Python code by classes and functions"
1313
readme = "README.md"

0 commit comments

Comments
 (0)