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
Copy file name to clipboardExpand all lines: RELEASE.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,81 @@ The very first release should be "0.1.0".
22
22
23
23
## Releases
24
24
25
+
GLiNER supports two release methods: **automated releases via GitHub Actions** (recommended) and manual releases via `twine`. The automated method is preferred as it ensures consistency and uses PyPI's trusted publishing.
26
+
27
+
### Automated Release via GitHub Actions (Recommended)
28
+
29
+
The repository includes a GitHub Actions workflow (`.github/workflows/release.yaml`) that automatically builds and publishes releases to PyPI when you push a version tag to the main branch.
30
+
31
+
#### Prerequisites
32
+
33
+
1. Ensure PyPI trusted publishing is configured for the GLiNER project in your PyPI account settings
34
+
2. The GitHub Actions workflow must have the proper PyPI environment configured
35
+
36
+
#### Steps for Automated Release
37
+
38
+
**Step 1: Adjust the version of your package**
39
+
40
+
Update the version in [`gliner/__init__.py`](gliner/__init__.py) from dev to release version:
41
+
42
+
```diff
43
+
- __version__ = "0.4.0.dev"
44
+
+ __version__ = "0.4.0"
45
+
```
46
+
47
+
Commit and push to main:
48
+
49
+
```bash
50
+
git add gliner
51
+
git commit -m "Release: v{VERSION}"
52
+
git push origin main
53
+
```
54
+
55
+
**Step 2: Create and push a version tag**
56
+
57
+
Create a tag matching the pattern `v*` (e.g., `v0.4.0`) and push it to trigger the release:
58
+
59
+
```bash
60
+
git tag v<VERSION>
61
+
git push origin v<VERSION>
62
+
```
63
+
64
+
**Important:** The tag MUST be pushed to the main branch. The workflow will automatically verify this and fail if the tag is from any other branch.
65
+
66
+
**Step 3: Monitor the GitHub Actions workflow**
67
+
68
+
1. Go to [https://github.com/urchade/GLiNER/actions](https://github.com/urchade/GLiNER/actions)
69
+
2. Watch the "Release GLiNER to PyPI" workflow execution
70
+
3. The workflow will:
71
+
- Build the distribution packages (wheel and source tarball)
72
+
- Verify the tag is on the main branch
73
+
- Publish to PyPI using trusted publishing
74
+
75
+
**Step 4: (Optional) Prepare release notes**
76
+
77
+
Create release notes on GitHub at [https://github.com/urchade/GLiNER/releases](https://github.com/urchade/GLiNER/releases) using the tag you just created.
78
+
79
+
**Step 5: Bump the dev version**
80
+
81
+
After a successful release, update [`gliner/__init__.py`](gliner/__init__.py) to the next dev version:
82
+
83
+
```diff
84
+
- __version__ = "0.4.0"
85
+
+ __version__ = "0.4.1.dev"
86
+
```
87
+
88
+
Commit and push:
89
+
90
+
```bash
91
+
git add gliner
92
+
git commit -m "Bump version to {NEXT_VERSION}.dev"
93
+
git push origin main
94
+
```
95
+
96
+
### Manual Release via twine
97
+
98
+
If you need to release manually or the automated workflow is unavailable, follow these steps:
99
+
25
100
### Step 1: Adjust the version of your package
26
101
27
102
You should have the current version specified in [`gliner/__init__.py`](gliner/__init__.py). This version should be a dev version (e.g. `0.1.0.dev`) before you release, change it to the name of the version you are releasing:
@@ -154,3 +229,5 @@ Go back to the draft you did at step 4 ([https://github.com/urchade/GLiNER/relea
154
229
### Step 9: Bump the dev version on the main branch
155
230
156
231
You’re almost done! Just go back to the `main` branch and change the dev version in [`gliner/__init__.py`](gliner/__init__.py) to the new version you’re developing, for instance `4.13.0.dev` if just released `4.12.0`.
232
+
233
+
**Note:** This step applies to both the automated and manual release processes.
0 commit comments