File tree 7 files changed +131
-0
lines changed
7 files changed +131
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish to PyPI via Trusted Publisher
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Update Version"]
6
+ types :
7
+ - completed
8
+
9
+ jobs :
10
+
11
+ publish :
12
+ runs-on : ubuntu-latest
13
+
14
+ permissions :
15
+ id-token : write
16
+ contents : read
17
+
18
+ steps :
19
+ - name : Checkout code
20
+ uses : actions/checkout@v3
21
+ with :
22
+ fetch-depth : 0
23
+
24
+ - name : Set up Python
25
+ uses : actions/setup-python@v4
26
+ with :
27
+ python-version : " 3.9"
28
+
29
+ - name : Install dependencies
30
+ run : |
31
+ python -m pip install --upgrade pip
32
+ pip install --upgrade setuptools wheel build
33
+
34
+ - name : Build the package
35
+ run : |
36
+ python setup.py sdist # 暂不加bdist_wheel,先使用源码编译,后续会改进
37
+
38
+ - name : Pypi Publish
39
+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change
1
+ name : Publish to TestPyPI
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["Update Version"]
6
+ types :
7
+ - completed
8
+
9
+ jobs :
10
+ publish :
11
+ runs-on : ubuntu-latest
12
+
13
+ permissions :
14
+ contents : read
15
+
16
+ steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v3
19
+ with :
20
+ fetch-depth : 0
21
+
22
+ - name : Set up Python
23
+ uses : actions/setup-python@v4
24
+ with :
25
+ python-version : " 3.9"
26
+
27
+ - name : Install dependencies
28
+ run : |
29
+ python -m pip install --upgrade pip
30
+ pip install --upgrade setuptools wheel build twine
31
+
32
+ - name : Build the package
33
+ run : |
34
+ python setup.py sdist
35
+
36
+ - name : Publish to TestPyPI
37
+ env :
38
+ TWINE_USERNAME : __token__
39
+ TWINE_PASSWORD : ${{ secrets.TESTPYPI_API_TOKEN }}
40
+ run : |
41
+ python -m twine upload --repository testpypi dist/*
Original file line number Diff line number Diff line change
1
+ name : Update Version
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " *"
7
+
8
+ jobs :
9
+ update-version :
10
+ runs-on : ubuntu-latest
11
+
12
+ permissions :
13
+ contents : write
14
+
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v3
18
+ with :
19
+ fetch-depth : 0
20
+
21
+ - name : Switch to main branch
22
+ run : |
23
+ git checkout main
24
+
25
+ - name : Update _version.py
26
+ run : |
27
+ TAG_NAME=$(echo ${{ github.ref_name }})
28
+ echo "__version__ = '${TAG_NAME:1}'" > pyfmm_gui/_version.py
29
+
30
+ - name : Commit changes
31
+ run : |
32
+ git config user.name "github-actions[bot]"
33
+ git config user.email "github-actions[bot]@users.noreply.github.com"
34
+ git add pyfmm_gui/_version.py
35
+ git commit -m "Update version to ${{ github.ref_name }}"
36
+ git push origin main # 推送到 "main" 分支
37
+
38
+
Original file line number Diff line number Diff line change 1
1
/__pycache__
2
2
/build
3
+ /dist
3
4
/* .egg-info
4
5
/pyfmm_gui /__pycache__
Original file line number Diff line number Diff line change
1
+ include pyfmm_gui/*
Original file line number Diff line number Diff line change 5
5
<p align =" center " >
6
6
<img alt =" GitHub code size in bytes " src =" https://img.shields.io/github/languages/code-size/Dengda98/PyFMM-GUI " >
7
7
<img alt =" GitHub License " src =" https://img.shields.io/github/license/Dengda98/PyFMM-GUI " >
8
+ <img alt =" GitHub Actions Workflow Status " src =" https://img.shields.io/github/actions/workflow/status/Dengda98/PyFMM-GUI/update_version.yml?label=update%20version " >
9
+ <img alt =" GitHub Actions Workflow Status " src =" https://img.shields.io/github/actions/workflow/status/Dengda98/PyFMM-GUI/publish_pypi.yml?label=pypi%20publish " >
8
10
</p >
9
11
10
12
基于PyQt5开发的简易图形界面,用于计算任意速度场下的二维全局走时场。计算模块基于[ *** PyFMM*** ] ( https://github.com/Dengda98/PyFMM ) 。
Original file line number Diff line number Diff line change @@ -8,19 +8,28 @@ def read_version():
8
8
exec (f .read ())
9
9
return locals ()['__version__' ]
10
10
11
+ def read_readme ():
12
+ with open ("README.md" , encoding = "utf-8" ) as f :
13
+ return f .read ()
14
+
11
15
setup (
12
16
name = 'pyfmm_gui' ,
13
17
version = read_version (),
14
18
description = 'A simple GUI of PyFMM' ,
15
19
author = 'Zhu Dengda' ,
16
20
21
+ long_description = read_readme (),
22
+ long_description_content_type = "text/markdown" ,
23
+ url = "https://github.com/Dengda98/PyFMM-GUI" ,
24
+
17
25
packages = find_packages (),
18
26
package_data = {'pyfmm_gui' : ['main.ui' ]},
19
27
include_package_data = True ,
20
28
python_requires = '>=3.9' ,
21
29
entry_points = {
22
30
'console_scripts' : [
23
31
'pyfmm_gui=pyfmm_gui.main:main' ,
32
+ 'pyfmm-gui=pyfmm_gui.main:main' ,
24
33
],
25
34
},
26
35
)
You can’t perform that action at this time.
0 commit comments