File tree 2 files changed +50
-21
lines changed 2 files changed +50
-21
lines changed Original file line number Diff line number Diff line change 60
60
61
61
publish :
62
62
needs : test
63
- name : Upload release to PyPI
63
+ name : Create Artifact
64
64
runs-on : ubuntu-latest
65
- permissions :
66
- id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
67
- contents : write
68
65
steps :
69
66
- uses : actions/checkout@v3
70
67
with :
84
81
uses : actions/upload-artifact@v3
85
82
with :
86
83
name : python-packages
87
- path : dist
88
- - name : Create Release and Upload
89
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
90
- id : create_release
91
- env :
92
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
93
- run : |
94
- gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --verify-tag --generate-notes --title "Release ${{ github.ref_name }}"
95
- gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} dist/*
96
-
97
-
98
- - name : PyPI Publish package
99
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
100
- # hash for release/v1.8
101
- uses : pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d
102
- with :
103
- password : ${{ secrets.PYPI_API_TOKEN }}
84
+ path : dist
Original file line number Diff line number Diff line change
1
+ name : Publish Package
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - ' v*'
7
+
8
+ concurrency :
9
+ group : publish
10
+
11
+
12
+ jobs :
13
+ publish :
14
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
15
+ name : Upload release to Github Releases and PyPI
16
+ runs-on : ubuntu-latest
17
+ permissions :
18
+ id-token : write
19
+ contents : write
20
+ environment : publish
21
+ steps :
22
+ - uses : actions/checkout@v3
23
+ with :
24
+ fetch-depth : 0
25
+ - name : Set up Python 3.11
26
+ uses : actions/setup-python@v4
27
+ with :
28
+ python-version : " 3.11"
29
+ - name : Build package
30
+ run : |
31
+ python -m pip install twine build
32
+ python -m build --wheel --sdist
33
+ python -m twine check dist/*
34
+ ls -la dist
35
+ - name : Create Release and Upload
36
+ id : create_release
37
+ env :
38
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39
+ run : |
40
+ gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --verify-tag --generate-notes --title "Release ${{ github.ref_name }}"
41
+ gh release upload ${{ github.ref_name }} --repo ${{ github.repository }} dist/*
42
+
43
+
44
+ - name : PyPI Publish package
45
+ # hash for release/v1.8
46
+ uses : pypa/gh-action-pypi-publish@0bf742be3ebe032c25dd15117957dc15d0cfc38d
47
+ with :
48
+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments