@@ -4,39 +4,46 @@ name: Publish Python Package
4
4
5
5
on :
6
6
release :
7
- types : [created, updated ]
7
+ types : [created]
8
8
9
9
jobs :
10
- deploy :
11
-
10
+ build :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v3
14
+
15
+ - uses : actions/setup-python@v3
16
+ with :
17
+ python-version : ' 3.x'
18
+
19
+ - name : Install dependencies
20
+ run : |
21
+ python -m pip install --upgrade pip
22
+ pip install setuptools wheel
23
+
24
+ - name : Build
25
+ run : |
26
+ python setup.py sdist bdist_wheel
27
+
28
+ - uses : actions/upload-artifact@v3
29
+ with :
30
+ path : ./dist
31
+
32
+ pypi-publish :
33
+ needs : ['build']
34
+ environment :
35
+ name : publish
36
+ url : ' https://pypi.org/project/labelbox/'
12
37
runs-on : ubuntu-latest
13
-
14
38
permissions :
15
39
# IMPORTANT: this permission is mandatory for trusted publishing
16
40
id-token : write
17
-
18
41
steps :
19
- - uses : actions/checkout@v2
20
-
21
- - name : Set up Python
22
- uses : actions/setup-python@v2
23
- with :
24
- python-version : ' 3.x'
25
-
26
- - name : Install dependencies
27
- run : |
28
- python -m pip install --upgrade pip
29
- pip install setuptools wheel twine
30
-
31
- - name : Build
32
- run : |
33
- python setup.py sdist bdist_wheel
34
-
35
- # - name: Publish
36
- # env:
37
- # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
38
- # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
39
- # run: |
40
- # twine upload dist/*
41
- - name : Publish package distributions to PyPI
42
- uses : pypa/gh-action-pypi-publish@release/v1
42
+ - uses : actions/download-artifact@v3
43
+
44
+ - name : Publish package distributions to PyPI
45
+ uses : pypa/gh-action-pypi-publish@release/v1
46
+ with :
47
+ packages-dir : artifact/
48
+
49
+ # Note that the build and pypi-publish jobs are split so that the additional permissions are only granted to the pypi-publish job.
0 commit comments