Skip to content

Commit ba326ae

Browse files
committed
feat: Add GitHub Actions workflow for release on tag and update project files
Signed-off-by: Avishrant Sharma <[email protected]>
1 parent f700de4 commit ba326ae

File tree

4 files changed

+104
-5
lines changed

4 files changed

+104
-5
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release on Tag
2+
3+
run-name: Release ${{ github.ref_name }}
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
build:
15+
name: Build with UV
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install uv
27+
run: pip install uv
28+
29+
- name: Build wheel and source distribution
30+
run: uv build
31+
32+
- name: Upload build artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: dist-artifacts
36+
path: dist/*
37+
retention-days: 5
38+
39+
release:
40+
name: Create Release
41+
needs: build
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Download build artifacts
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: dist-artifacts
51+
path: dist/
52+
53+
- name: Extract tag name
54+
id: tag
55+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
56+
57+
- name: Create Draft Release
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: ${{ steps.tag.outputs.tag }}
61+
name: Release ${{ steps.tag.outputs.tag }}
62+
draft: true
63+
files: dist/*
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
UV_EXISTS := $(shell command -v uv 2> /dev/null)
2+
3+
install:
4+
@echo "-> Configuring uv package manager"
5+
ifndef UV_EXISTS
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
endif
8+
uv venv --python 3.12
9+
10+
dev: install
11+
@echo "-> Installing Developer Dependencies"
12+
uv sync
13+
uvx pre-commit install
14+
15+
format:
16+
@echo "Formatting code..."
17+
uvx --offline ruff check --fix . || true
18+
uvx --offline ruff format .
19+
20+
clean: format
21+
@echo "Clearing python cache"
22+
find . -type f -name '*.pyc' -delete
23+
find . -type d -name '__pycache__' -delete
24+
@echo "Clearing build files"
25+
rm -rf build dist *.egg-info .*_cache
26+
27+
package: clean
28+
@echo "Packaging code..."
29+
uv build
30+
31+
remove-hooks:
32+
@echo "-> Removing the pre-commit hooks"
33+
uv run pre-commit uninstall

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python-pptx-stubs
22

3-
This package contains [type stubs](https://www.python.org/dev/peps/pep-0561/) to provide more precise static types and type inference for the [python-pptx](https://github.com/scanny/python-pptx) project.
3+
This package contains [type stubs](https://www.python.org/dev/peps/pep-0561/) to provide more precise static types and type inference for the [python-pptx](https://github.com/scanny/python-pptx) project.
44

55
**python-pptx** heavily relies on dynamic attribute generation and runtime magic for its functionality. This project aims to add type annotations for the most common patterns used in the parent library.
66

@@ -22,7 +22,7 @@ This project follows the same versioning as python-pptx where possible.
2222

2323
| Stubs Version | python-pptx Version | Python Version | Status |
2424
|---------------|---------------------|----------------|---------|
25-
| 1.0.2 | 1.0.2 | 3.12+ | Active |
25+
| 1.0.2.post1 | 1.0.2 | 3.12+ | Active |
2626

2727
## Usage
2828

@@ -39,4 +39,4 @@ Found an issue or want to contribute?
3939

4040
## License
4141

42-
MIT License - see [LICENSE](LICENSE) file for details
42+
MIT License - see [LICENSE](LICENSE) file for details

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[project]
22
name = "python-pptx-stubs"
3-
version = "1.0.2"
3+
version = "1.0.2.post1"
44
description = "Type stubs for python-pptx package"
55
authors = [{ name = "Avishrant Sharma", email = "[email protected]" }]
66
requires-python = ">=3.12"
77
license = { text = "MIT" }
88
readme = "README.md"
99
dependencies = [
10-
"python-pptx>=1.0.2",
10+
"lxml_stubs",
11+
"python-pptx==1.0.2",
1112
]
1213

1314
# This marks it as a PEP 561 type stub package

0 commit comments

Comments
 (0)