44 release :
55 types : [published]
66
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+ cancel-in-progress : true
10+
711jobs :
8- publish :
12+
13+ build-whl :
14+ runs-on : ${{ matrix.os }}
15+ strategy :
16+ matrix :
17+ os : [ windows-latest, macos-latest ] # ubuntu-latest,
18+ python : [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]
19+ exclude :
20+ - os : windows-latest
21+ python : " 3.14"
22+ - os : macos-latest
23+ python : " 3.8"
24+ - os : macos-latest
25+ python : " 3.7"
26+ # - os: ubuntu-latest
27+ # python: "3.7"
28+
29+ steps :
30+ - uses : actions/checkout@v4
31+
32+ - name : Install Python 3.14 with pyenv (if needed)
33+ if : ${{ matrix.python == '3.14' }}
34+ run : |
35+ curl https://pyenv.run | bash
36+ export PATH="$HOME/.pyenv/bin:$PATH"
37+ eval "$(pyenv init --path)"
38+ eval "$(pyenv init -)"
39+ pyenv install 3.14-dev
40+ pyenv global 3.14-dev
41+
42+ - name : Setup Python
43+ if : ${{ matrix.python != '3.14' }}
44+ uses : actions/setup-python@v5
45+ with :
46+ python-version : ${{ matrix.python }}
47+
48+ - name : Install build tools
49+ run : pip install build twine wheel auditwheel
50+
51+ - name : Build wheel
52+ run : python -m build --wheel
53+
54+ - name : Repair the wheel for manylinux compatibility
55+ if : ${{ runner.os == 'Linux' }}
56+ run : auditwheel repair dist/*.whl -w dist/
57+
58+ - name : Upload built packages
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : pkg-${{ matrix.os }}-${{ matrix.python }}-${{ strategy.job-index }}
62+ path : |
63+ ./dist/*.whl
64+
65+ build-sdist :
966 runs-on : ubuntu-latest
1067
1168 steps :
12- - name : Checkout code
13- uses : actions/checkout@v4
69+ - uses : actions/checkout@v4
1470
1571 - uses : actions/setup-python@v5
1672 with :
@@ -19,11 +75,33 @@ jobs:
1975 - name : Install build tools
2076 run : pip install build twine wheel
2177
22- - name : Build package
23- run : python -m build
78+ - name : Build source distribution
79+ run : python -m build --sdist
80+
81+ - name : Upload built packages
82+ uses : actions/upload-artifact@v4
83+ with :
84+ name : pkg-sdist
85+ path : |
86+ ./dist/*.tar.gz
87+
88+ publish :
89+ needs : [build-whl, build-sdist]
90+ runs-on : ubuntu-latest
91+
92+ environment :
93+ name : release
94+ url : https://pypi.org/project/flask-inputfilter
95+
96+ permissions :
97+ id-token : write
98+
99+ steps :
100+ - name : Download built packages
101+ uses : actions/download-artifact@v4
102+ with :
103+ path : dist
104+ merge-multiple : true
24105
25- - name : Publish to PyPI
26- env :
27- TWINE_USERNAME : __token__
28- TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
29- run : twine upload dist/*.tar.gz
106+ - name : Publish package to PyPI
107+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments