Skip to content

Commit f7f53ee

Browse files
feat: add publishing workflow
1 parent efd0171 commit f7f53ee

6 files changed

Lines changed: 97 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,3 @@ jobs:
133133
with:
134134
name: dist
135135
path: dist/
136-
137-
pypi-publish:
138-
name: Upload release to PyPI
139-
runs-on: ubuntu-latest
140-
permissions:
141-
id-token: write
142-
steps:
143-
- name: Publish package distributions to PyPI
144-
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi-publish:
9+
name: Upload release to PyPI
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Required for trusted publishing
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install build dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build twine
26+
27+
- name: Build package
28+
run: python -m build
29+
30+
- name: Check package
31+
run: twine check dist/*
32+
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
# This should match your package name in pyproject.toml
23+
release-type: python
24+
package-name: altertable-flightsql

.release-please-manifest.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
".": "0.1.0"
3+
}
4+

pyproject.toml

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

55
[project]
66
name = "altertable-flightsql"
7-
version = "0.1.0"
7+
dynamic = ["version"]
88
description = "Python client library for Altertable"
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -56,6 +56,9 @@ Repository = "https://github.com/yourusername/altertable-flightsql"
5656
[tool.setuptools]
5757
package-dir = {"" = "src"}
5858

59+
[tool.setuptools.dynamic]
60+
version = {attr = "altertable_flightsql.__version__"}
61+
5962
[tool.setuptools.packages.find]
6063
where = ["src"]
6164
include = ["altertable_flightsql*"]

release-please-config.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "python",
5+
"package-name": "altertable-flightsql",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"changelog-sections": [
9+
{"type": "feat", "section": "Features", "hidden": false},
10+
{"type": "fix", "section": "Bug Fixes", "hidden": false},
11+
{"type": "perf", "section": "Performance Improvements", "hidden": false},
12+
{"type": "revert", "section": "Reverts", "hidden": false},
13+
{"type": "docs", "section": "Documentation", "hidden": false},
14+
{"type": "style", "section": "Styles", "hidden": true},
15+
{"type": "chore", "section": "Miscellaneous Chores", "hidden": true},
16+
{"type": "refactor", "section": "Code Refactoring", "hidden": false},
17+
{"type": "test", "section": "Tests", "hidden": true},
18+
{"type": "build", "section": "Build System", "hidden": true},
19+
{"type": "ci", "section": "Continuous Integration", "hidden": true}
20+
],
21+
"extra-files": [
22+
{
23+
"type": "python",
24+
"path": "src/altertable_flightsql/__init__.py",
25+
"glob": false
26+
}
27+
]
28+
}
29+
}
30+
}
31+

0 commit comments

Comments
 (0)