You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fetch-depth: 0# PSR needs full history + tags to compute the bump
85
+
ref: ${{ github.event.pull_request.head.sha }}
86
+
87
+
- name: Set up the environment
88
+
uses: ./.github/actions/setup-python-env
89
+
90
+
- name: Compute release preview
91
+
id: preview
92
+
run: |
93
+
current=$(uv version --short 2>/dev/null || echo "unknown")
94
+
next=$(uv run semantic-release version --print 2>/dev/null || echo "")
95
+
if [ -n "$next" ] && [ "$next" != "$current" ]; then
96
+
echo "released=true" >> "$GITHUB_OUTPUT"
97
+
else
98
+
echo "released=false" >> "$GITHUB_OUTPUT"
99
+
fi
100
+
echo "current=$current" >> "$GITHUB_OUTPUT"
101
+
echo "next=$next" >> "$GITHUB_OUTPUT"
102
+
{
103
+
echo "changelog<<PSR_EOF"
104
+
uv run semantic-release changelog --print 2>/dev/null | head -60 || echo "(no changelog preview)"
105
+
echo "PSR_EOF"
106
+
} >> "$GITHUB_OUTPUT"
107
+
108
+
- name: Post release preview comment
109
+
uses: marocchino/sticky-pull-request-comment@v2
110
+
with:
111
+
header: version-preview
112
+
message: |
113
+
## Release preview
114
+
115
+
${{ steps.preview.outputs.released == 'true' && format('Merging this PR would release **v{0}** (current: `{1}`).', steps.preview.outputs.next, steps.preview.outputs.current) || format('No version bump from the current commits (stays at `{0}`). Use conventional commit types (`feat`, `fix`, ...) to trigger a release.', steps.preview.outputs.current) }}
Copy file name to clipboardExpand all lines: CITATION.cff
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@ cff-version: 1.2.0
2
2
message: "If you use this software, please cite it as below."
3
3
type: software
4
4
title: "oold-python: Object Oriented Linked Data for Python"
5
+
# Managed by python-semantic-release (version_variables). Do not edit by hand.
6
+
version: 0.16.2
5
7
abstract: "A Python package for abstract and object-oriented access to knowledge graphs, bridging semantic web technologies (RDF, JSON-LD, SPARQL) with Pydantic type safety."
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+37-10Lines changed: 37 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,14 @@ make install
20
20
Without `make`:
21
21
22
22
```bash
23
-
uv sync
23
+
uv sync --all-extras
24
24
uv run pre-commit install
25
25
```
26
26
27
+
`pre-commit install` installs both the `pre-commit` and `commit-msg` stage hooks
28
+
(via `default_install_hook_types`); the latter enforces Conventional Commits (see
29
+
below).
30
+
27
31
## Making Changes
28
32
29
33
1. Create a branch: `git checkout -b name-of-your-fix`
@@ -66,19 +70,42 @@ uv run zensical serve
66
70
uv run zensical build -s
67
71
```
68
72
69
-
## Releasing
73
+
## Commit messages (Conventional Commits)
74
+
75
+
This project uses [Conventional Commits](https://www.conventionalcommits.org/).
76
+
Commit messages drive versioning and the changelog automatically, so the format
77
+
matters. The local `commit-msg` hook rejects malformed messages.
78
+
79
+
Format: `type(scope): subject`, for example `fix: correct sidebar collapse on
80
+
small screens`. The scope is optional.
70
81
71
-
Releases are published automatically by CI when a version tag is pushed.
82
+
| Type | Release effect | Use for |
83
+
| ---- | -------------- | ------- |
84
+
|`feat`| minor bump | a new feature |
85
+
|`fix`| patch bump | a bug fix |
86
+
|`perf`| patch bump | a performance improvement |
87
+
|`docs`, `chore`, `test`, `refactor`, `ci`, `style`, `build`| no release | changes that do not ship user-facing behavior |
88
+
|`BREAKING CHANGE:` footer, or `!` after the type | major bump | an incompatible change |
89
+
90
+
A breaking change is marked either with a `!` (`feat!: drop Python 3.9`) or a
91
+
`BREAKING CHANGE:` footer in the commit body.
92
+
93
+
## Releasing
72
94
73
-
1. Ensure all changes are merged to `main`
74
-
2. Tag the commit and push:
95
+
Releases are fully automated by python-semantic-release. You do not tag or bump
96
+
the version by hand.
75
97
76
-
```bash
77
-
git tag v0.17.0
78
-
git push origin v0.17.0
79
-
```
98
+
1. Open a PR. CI comments the version that a merge would release, based on your
99
+
commits.
100
+
2. Merge to `main`. On merge, CI reads the new conventional commits, bumps the
101
+
version in `pyproject.toml` and `CITATION.cff`, updates `CHANGELOG.md`,
102
+
commits with `[skip ci]`, and pushes the `vX.Y.Z` tag.
103
+
3. CI then builds the package, publishes it to PyPI via OIDC trusted publishing,
104
+
and deploys the docs to GitHub Pages.
80
105
81
-
CI will build the package (`uv build`), publish it to PyPI, and deploy the docs to GitHub Pages. The version is derived from the git tag via `hatch-vcs`, so no manual version bumping is needed.
106
+
If a merge contains only non-releasing commit types (for example `docs` or
107
+
`chore`), no release is cut. The version lives in `pyproject.toml`; never edit it
0 commit comments