File tree 1 file changed +28
-16
lines changed
1 file changed +28
-16
lines changed Original file line number Diff line number Diff line change 1
- name : cd
1
+ name : Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2
2
3
3
on :
4
4
release :
5
- types :
6
- - published
7
-
8
- permissions :
9
- id-token : write
10
- contents : read
5
+ types : [published] # This will trigger the workflow when you create a new release
11
6
12
7
jobs :
13
- publish_to_pypi :
14
- name : publish to pypi on new release
8
+ build-n-publish :
9
+ name : Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
15
10
runs-on : ubuntu-latest
11
+ permissions :
12
+ # IMPORTANT: this permission is mandatory for trusted publishing
13
+ id-token : write
16
14
steps :
17
- - uses : actions/checkout@v3
18
-
19
- name : Build and publish to PyPI
15
+ - uses : actions/checkout@v2
16
+
17
+ - name : Set up Python
18
+ uses : actions/setup-python@v2
20
19
with :
21
- pypi_token : ${{ secrets.PYPI_TOKEN }}
22
- ignore_dev_requirements : " yes"
23
- repository_url : https://upload.pypi.org/legacy/
24
- repository_name : embedchain
20
+ python-version : 3.10
21
+
22
+ - name : Install pep517
23
+ run : |
24
+ python -m pip install pep517 --user
25
+
26
+ - name : Build a binary wheel and a source tarball
27
+ run : python -m pep517.build .
28
+
29
+ - name : Publish distribution 📦 to Test PyPI
30
+ uses : pypa/gh-action-pypi-publish@release/v1
31
+ with :
32
+ repository_url : https://test.pypi.org/legacy/
33
+
34
+ - name : Publish distribution 📦 to PyPI
35
+ if : startsWith(github.ref, 'refs/tags')
36
+ uses : pypa/gh-action-pypi-publish@release/v1
You can’t perform that action at this time.
0 commit comments