File tree Expand file tree Collapse file tree 2 files changed +46
-13
lines changed Expand file tree Collapse file tree 2 files changed +46
-13
lines changed Original file line number Diff line number Diff line change 1
- name : Publish Python Package
1
+ name : Publish to PyPI
2
2
3
3
on :
4
- release :
5
- types : [published]
4
+ push :
5
+ tags :
6
+ - ' v*'
6
7
7
8
permissions :
8
9
contents : read
9
10
10
11
jobs :
12
+
11
13
build-and-publish :
14
+ name : Build and publish
12
15
runs-on : ubuntu-latest
16
+ environment : pypi
17
+ permissions :
18
+ id-token : write
13
19
steps :
14
20
- name : Check out source
15
- uses : actions/checkout@v3
16
-
21
+ uses : actions/checkout@v4
17
22
- name : Set up Python
18
- uses : actions/setup-python@v4
23
+ uses : actions/setup-python@v5
19
24
with :
20
25
python-version : ' 3.x'
21
-
22
26
- name : Install dependencies
23
27
run : |
24
28
python -m pip install --upgrade pip
25
29
pip install build
26
-
27
30
- name : Build package
28
31
run : python -m build
29
-
30
32
- name : Publish package
31
33
uses : pypa/gh-action-pypi-publish@release/v1
32
- with :
33
- user : __token__
34
- password : ${{ secrets.PYPI_API_TOKEN }}
35
- skip-existing : true
Original file line number Diff line number Diff line change
1
+ name : Publish to Test PyPI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ permissions :
9
+ contents : read
10
+
11
+ jobs :
12
+
13
+ build-and-publish :
14
+ name : Build and publish
15
+ runs-on : ubuntu-latest
16
+ environment : test-pypi
17
+ steps :
18
+ - name : Check out source
19
+ uses : actions/checkout@v4
20
+ - name : Set up Python
21
+ uses : actions/setup-python@v5
22
+ with :
23
+ python-version : ' 3.x'
24
+ - name : Install dependencies
25
+ run : |
26
+ python -m pip install --upgrade pip
27
+ pip install build
28
+ - name : Build package
29
+ run : python -m build
30
+ - name : Publish package
31
+ uses : pypa/gh-action-pypi-publish@release/v1
32
+ with :
33
+ repository-url : https://test.pypi.org/legacy/
34
+ skip-existing : true
35
+ verbose : true
You can’t perform that action at this time.
0 commit comments