File tree 2 files changed +51
-28
lines changed
2 files changed +51
-28
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish
2
2
3
3
on :
4
- release :
5
- types : [published, edited]
4
+ release :
5
+ types : [published]
6
+ workflow_dispatch :
6
7
7
8
jobs :
8
- publish :
9
- runs-on : ubuntu-latest
10
- steps :
11
- - uses : actions/checkout@v3
12
-
13
- - name : Set up Python
14
- uses : actions/setup-python@v4
15
- with :
16
- python-version : " 3.x"
17
-
18
- - name : Python info
19
- run : |
20
- which python
21
- python --version
22
-
23
- - name : Install dependencies
24
- run : pip build
25
-
26
- - name : Build the package
27
- run : python -m build --sdist --wheel
28
-
29
- - name : Publish the package
30
- uses : pypa/gh-action-pypi-publish@release/v1
31
- with :
32
- user : __token__
33
- password : ${{ secrets.PYPI_TOKEN }}
9
+ publish :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v3
13
+
14
+ - name : Set up Python
15
+ uses : actions/setup-python@v4
16
+ with :
17
+ python-version : ' 3.x'
18
+
19
+ - name : Install dependencies
20
+ run : pip install build twine
21
+
22
+ - name : Python info
23
+ run : |
24
+ which python
25
+ python --version
26
+
27
+ - name : Installed packages
28
+ run : pip list
29
+
30
+ - name : Build the package
31
+ run : python -m build --sdist --wheel
32
+
33
+ - name : Validate wheels
34
+ run : |
35
+ tree dist
36
+ twine check dist/*
37
+
38
+ - uses : actions/upload-artifact@v3
39
+ with :
40
+ name : wheels
41
+ path : ./build/*
42
+
43
+ - name : Publish the package
44
+ if : github.event_name == 'release'
45
+ uses : pypa/gh-action-pypi-publish@release/v1
46
+ with :
47
+ user : __token__
48
+ password : ${{ secrets.PYPI_TOKEN }}
49
+
50
+ - name : Attach wheels to GitHub release
51
+ if : github.event_name == 'release'
52
+
53
+ with :
54
+ files : ' dist/*'
55
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 8
8
branches :
9
9
- master
10
10
pull_request :
11
+ workflow_dispatch :
11
12
12
13
concurrency :
13
14
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
You can’t perform that action at this time.
0 commit comments