Skip to content

Commit b4850d8

Browse files
committed
ci: add release workflow and update dependencies
1 parent 70b719b commit b4850d8

File tree

3 files changed

+119
-7
lines changed

3 files changed

+119
-7
lines changed

.github/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- skip-changelog
5+
authors:
6+
- octocat
7+
categories:
8+
- title: "🚀 Features"
9+
labels:
10+
- feature
11+
- enhancement
12+
- title: "🐛 Bug Fixes"
13+
labels:
14+
- bug
15+
- fix
16+
- title: "📖 Documentation"
17+
labels:
18+
- documentation
19+
- docs
20+
- title: "⚙️ Refactoring"
21+
labels:
22+
- refactor
23+
- title: "🔧 Maintenance"
24+
labels:
25+
- chore
26+
- dependencies
27+
- title: "🧪 Testing"
28+
labels:
29+
- test
30+
- testing
31+
- title: "Other Changes"
32+
labels:
33+
- "*"

.github/workflows/release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to release'
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
id-token: write
16+
17+
jobs:
18+
create-github-release:
19+
name: Create GitHub Release
20+
runs-on: ubuntu-latest
21+
outputs:
22+
tag_name: ${{ steps.set-tag.outputs.tag }}
23+
steps:
24+
- uses: actions/checkout@v6
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Set tag name
29+
id: set-tag
30+
run: echo "tag=${{ github.event.inputs.tag || github.ref_name }}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v7
34+
with:
35+
python-version: "3.12"
36+
enable-cache: true
37+
38+
- name: Check version consistency
39+
run: |
40+
VERSION=$(grep -m 1 'version = ' pyproject.toml | cut -d '"' -f 2)
41+
TAG=${{ steps.set-tag.outputs.tag }}
42+
CLEAN_TAG=${TAG#v}
43+
if [ "$VERSION" != "$CLEAN_TAG" ]; then
44+
echo "Version in pyproject.toml ($VERSION) does not match tag ($TAG)"
45+
exit 1
46+
fi
47+
48+
- name: Build distribution
49+
run: uv build
50+
51+
- name: Create GitHub Release
52+
uses: softprops/action-gh-release@v2
53+
with:
54+
tag_name: ${{ steps.set-tag.outputs.tag }}
55+
name: ${{ steps.set-tag.outputs.tag }}
56+
generate_release_notes: true
57+
draft: false
58+
prerelease: ${{ contains(steps.set-tag.outputs.tag, 'a') || contains(steps.set-tag.outputs.tag, 'b') || contains(steps.set-tag.outputs.tag, 'rc') }}
59+
files: |
60+
dist/*.whl
61+
dist/*.tar.gz
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
65+
publish-to-pypi:
66+
name: Publish to PyPI
67+
needs: [create-github-release]
68+
runs-on: ubuntu-latest
69+
environment:
70+
name: pypi
71+
url: https://pypi.org/project/lsap/
72+
steps:
73+
- uses: actions/checkout@v6
74+
75+
- name: Install uv
76+
uses: astral-sh/setup-uv@v7
77+
with:
78+
python-version: "3.12"
79+
enable-cache: true
80+
81+
- name: Build distribution
82+
run: uv build
83+
84+
- name: Publish to PyPI
85+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"asyncer>=0.0.11",
1010
"attrs>=25.4.0",
1111
"cattrs>=25.3.0",
12-
"lsp-client",
12+
"lsp-client >= 0.3.0",
1313
"lsprotocol>=2025.0.0",
1414
"pydantic>=2.12.5",
1515
"python-liquid>=2.1.0",
@@ -19,12 +19,6 @@ dependencies = [
1919
requires = ["uv_build>=0.9.9,<0.10.0"]
2020
build-backend = "uv_build"
2121

22-
[tool.uv.workspace]
23-
members = ["lsap-schema"]
24-
25-
[tool.uv.sources]
26-
lsp-client = { git = "https://github.com/lsp-client/lsp-client.git", branch = "release/v0.3" }
27-
2822
[tool.pytest.ini_options]
2923
norecursedirs = ["references"]
3024
testpaths = ["tests"]

0 commit comments

Comments
 (0)