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