File tree Expand file tree Collapse file tree 2 files changed +59
-30
lines changed Expand file tree Collapse file tree 2 files changed +59
-30
lines changed Original file line number Diff line number Diff line change 1
- name : Publish Python distribution
1
+ name : Publish Python distribution to PyPI
2
2
3
3
on :
4
- push :
5
- branches :
6
- - master
4
+ release :
5
+ types : [published]
7
6
8
7
jobs :
9
8
build :
32
31
33
32
publish-to-pypi :
34
33
name : Publish to PyPI
35
- if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36
34
needs :
37
35
- build
38
36
runs-on : ubuntu-latest
50
48
path : dist/
51
49
- name : Publish to PyPI
52
50
uses : pypa/gh-action-pypi-publish@release/v1
53
-
54
- publish-to-testpypi :
55
- name : Publish to TestPyPI
56
- needs :
57
- - build
58
- runs-on : ubuntu-latest
59
-
60
- environment :
61
- name : testpypi
62
- url : https://test.pypi.org/p/lc-sdk-python
63
-
64
- permissions :
65
- id-token : write # IMPORTANT: mandatory for trusted publishing
66
-
67
- steps :
68
- - name : Download all the dists
69
- uses : actions/download-artifact@v3
70
- with :
71
- name : python-package-distributions
72
- path : dist/
73
- - name : Publish to TestPyPI
74
- uses : pypa/gh-action-pypi-publish@release/v1
75
- with :
76
- skip-existing : true
77
- repository-url : https://test.pypi.org/legacy/
Original file line number Diff line number Diff line change
1
+ name : Publish Python distribution to TestPyPI
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ jobs :
9
+ build :
10
+ name : Build distribution
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v4
17
+ with :
18
+ python-version : " 3.8"
19
+ - name : Install pypa/build
20
+ run : >-
21
+ python3 -m
22
+ pip install
23
+ build
24
+ --user
25
+ - name : Build a binary wheel and a source tarball
26
+ run : python3 -m build
27
+ - name : Store the distribution packages
28
+ uses : actions/upload-artifact@v3
29
+ with :
30
+ name : python-package-distributions
31
+ path : dist/
32
+
33
+ publish-to-testpypi :
34
+ name : Publish to TestPyPI
35
+ needs :
36
+ - build
37
+ runs-on : ubuntu-latest
38
+
39
+ environment :
40
+ name : testpypi
41
+ url : https://test.pypi.org/p/lc-sdk-python
42
+
43
+ permissions :
44
+ id-token : write # IMPORTANT: mandatory for trusted publishing
45
+
46
+ steps :
47
+ - name : Download all the dists
48
+ uses : actions/download-artifact@v3
49
+ with :
50
+ name : python-package-distributions
51
+ path : dist/
52
+ - name : Publish to TestPyPI
53
+ uses : pypa/gh-action-pypi-publish@release/v1
54
+ with :
55
+ skip-existing : true
56
+ repository-url : https://test.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments