File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish to Test PyPI
2
+
3
+ on :
4
+ push :
5
+ branches : ["develop", "main"]
6
+ release :
7
+ types : [published]
8
+
9
+ permissions :
10
+ contents : read
11
+
12
+ jobs :
13
+ deploy :
14
+
15
+ runs-on : ubuntu-latest
16
+
17
+ environment : release
18
+ permissions :
19
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
20
+
21
+ steps :
22
+ - uses : actions/checkout@v4
23
+ - name : Set up Python
24
+ uses : actions/setup-python@v4
25
+ with :
26
+ python-version : ' 3.10'
27
+ cache : ' pip'
28
+ - name : Install dependencies
29
+ run : |
30
+ # python -m pip install --upgrade pip
31
+ pip install hatch
32
+ - name : Build package
33
+ run : hatch build
34
+ # - name: Test package
35
+ # run: hatch -e test run nose2 --verbose
36
+ - name : Publish package distributions to Test PyPI
37
+ if : github.ref != 'refs/heads/main'
38
+ uses : pypa/gh-action-pypi-publish@release/v1
39
+ with :
40
+ skip-existing : true
41
+ repository-url : https://test.pypi.org/legacy/
42
+ - name : Publish package distributions to PyPI
43
+ if : github.ref == 'refs/heads/main'
44
+ uses : pypa/gh-action-pypi-publish@release/v1
45
+ with :
46
+ skip-existing : true
47
+ repository-url : https://upload.pypi.org/legacy/
You can’t perform that action at this time.
0 commit comments