File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to PyPI
2+
3+ on :
4+ release :
5+ types : [published]
6+ workflow_dispatch :
7+ inputs :
8+ test_pypi :
9+ description : ' Publish to TestPyPI instead of PyPI'
10+ required : false
11+ default : false
12+ type : boolean
13+
14+ jobs :
15+ build :
16+ name : Build distribution
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : " 3.x"
25+
26+ - name : Install build dependencies
27+ run : python -m pip install --upgrade pip build
28+
29+ - name : Build package
30+ run : python -m build
31+
32+ - name : Upload distribution artifacts
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : python-package-distributions
36+ path : dist/
37+
38+ publish-to-pypi :
39+ name : Publish to PyPI
40+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.test_pypi == false)
41+ needs : build
42+ runs-on : ubuntu-latest
43+ environment :
44+ name : pypi
45+ url : https://pypi.org/p/scrapy-proxy-headers
46+ permissions :
47+ id-token : write
48+ steps :
49+ - name : Download distribution artifacts
50+ uses : actions/download-artifact@v4
51+ with :
52+ name : python-package-distributions
53+ path : dist/
54+
55+ - name : Publish to PyPI
56+ uses : pypa/gh-action-pypi-publish@release/v1
57+
58+ publish-to-testpypi :
59+ name : Publish to TestPyPI
60+ if : github.event_name == 'workflow_dispatch' && inputs.test_pypi == true
61+ needs : build
62+ runs-on : ubuntu-latest
63+ environment :
64+ name : testpypi
65+ url : https://test.pypi.org/p/scrapy-proxy-headers
66+ permissions :
67+ id-token : write
68+ steps :
69+ - name : Download distribution artifacts
70+ uses : actions/download-artifact@v4
71+ with :
72+ name : python-package-distributions
73+ path : dist/
74+
75+ - name : Publish to TestPyPI
76+ uses : pypa/gh-action-pypi-publish@release/v1
77+ with :
78+ repository-url : https://test.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments