Skip to content

Commit df70f19

Browse files
committed
Added GitHub workflow for releases on PyPI.
1 parent d46e99c commit df70f19

3 files changed

Lines changed: 55 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Publish new release on PyPI.
2+
name: Publish release
3+
4+
on: [workflow_dispatch]
5+
6+
jobs:
7+
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- name: Check out code.
13+
uses: actions/checkout@v6
14+
15+
- name: Install Python.
16+
uses: actions/setup-python@v6
17+
with:
18+
python-version: '3.14'
19+
20+
- name: Install project.
21+
run: pip install --editable .[dev]
22+
23+
- name: Build wheel.
24+
run: flit build --format wheel
25+
26+
- name: Store wheel.
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: wheel
30+
path: dist
31+
32+
33+
publish:
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: PyPI
39+
url: https://pypi.org/p/Flake8-pyproject
40+
permissions:
41+
id-token: write
42+
steps:
43+
44+
- name: Download wheel.
45+
uses: actions/download-artifact@v5
46+
with:
47+
name: wheel
48+
path: dist
49+
50+
- name: Publish to PyPI.
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
with:
53+
packages-dir: dist

tools/ReadMe.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ virtual environment with `pip install --editable .[dev]`.
1212

1313
- Bump version number in `meta.py`.
1414
- Add dedicated commit for the version bump.
15-
- Tag commit with version number, e.g. `git tag 1.0.0`.
16-
- Push to GitHub: `git push && git push --tags`.
17-
- Create GitHub release from tag and add release notes.
18-
- Publish to PyPI: `tools/publish.py`.
15+
- Publish to PyPI via GitHub Action.
16+
- Create release on GitHub, tag it (like `v1.2.4`), add release notes.

tools/publish_wheel.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)