Skip to content

Commit ed43f8a

Browse files
committed
feat: add Release Please workflow for automated PyPI publishing
1 parent 8d3b15f commit ed43f8a

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
release_created: ${{ steps.release.outputs.release_created }}
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
id: release
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
publish:
23+
needs: release-please
24+
if: needs.release-please.outputs.release_created == 'true'
25+
runs-on: ubuntu-latest
26+
permissions:
27+
id-token: write
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: "3.12"
34+
35+
- name: Install build tools
36+
run: pip install build
37+
38+
- name: Build package
39+
run: python -m build
40+
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1

.release-please-manifest.json

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

release-please-config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "python",
5+
"package-name": "datons",
6+
"extra-files": [
7+
"pyproject.toml"
8+
],
9+
"changelog-sections": [
10+
{ "type": "feat", "section": "Features" },
11+
{ "type": "fix", "section": "Bug Fixes" },
12+
{ "type": "perf", "section": "Performance" },
13+
{ "type": "docs", "section": "Documentation", "hidden": true },
14+
{ "type": "chore", "section": "Miscellaneous", "hidden": true }
15+
]
16+
}
17+
},
18+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
19+
}

0 commit comments

Comments
 (0)