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