From 3a0ee13ec90d38284e467e19332abe67002c77d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Mon, 17 Aug 2026 08:44:57 +0200 Subject: [PATCH 1/3] chore: add publish workflow (#117) --- .github/workflows/publish.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..60a96ef --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,53 @@ +name: Publish to PyPI + +on: + push: + tags: + - "v*" + +jobs: + build: + name: Build distributions + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build + run: python -m pip install build + + - name: Build distributions + run: python -m build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: distributions + path: dist/ + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + + environment: + name: release + + permissions: + id-token: write + + steps: + - name: Download distributions + uses: actions/download-artifact@v4 + with: + name: distributions + path: dist/ + + - name: Publish distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From cb2caf185d31e750f11ed8557487117d3a96a312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Ho=C3=9Fbach?= Date: Mon, 17 Aug 2026 08:45:38 +0200 Subject: [PATCH 2/3] chore: bump minor version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c3f0fb7..1290059 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "python-lsp-ruff" authors = [ {name = "Julian Hossbach", email = "julian.hossbach@gmx.de"} ] -version = "2.3.2" +version = "2.3.3" description = "Ruff linting plugin for pylsp" readme = "README.md" requires-python = ">=3.8" From 547218badbe880e12e81c1ab09d7a4f37b3aaf23 Mon Sep 17 00:00:00 2001 From: Julian Hossbach Date: Mon, 17 Aug 2026 09:08:57 +0200 Subject: [PATCH 3/3] Harden workflow Add dispatch trigger, limit permissions to read-only. Minor conveniences --- .github/workflows/publish.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 60a96ef..95da1f5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,12 @@ on: tags: - "v*" + # Rerun workflow manually if the publish fails without new tag + workflow_dispatch: + +permissions: + contents: read + jobs: build: name: Build distributions @@ -12,24 +18,27 @@ jobs: steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: - python-version: "3.12" + python-version: "3.x" - name: Install build - run: python -m pip install build + run: python3 -m pip install --upgrade build - name: Build distributions - run: python -m build + run: python3 -m build - name: Upload distributions - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: distributions path: dist/ + if-no-files-found: error publish: name: Publish to PyPI @@ -38,13 +47,14 @@ jobs: environment: name: release + url: "https://pypi.org/project/python-lsp-ruff" permissions: id-token: write steps: - name: Download distributions - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: distributions path: dist/