Skip to content

Commit e0dee99

Browse files
committed
test workflow
1 parent 9185519 commit e0dee99

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

.github/workflows/publish_pypi.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tag/Release and Publish to PyPI via Trusted Publisher
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
update-version:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Update version
16+
run: |
17+
TAG_NAME=$(echo ${{ github.ref_name }})
18+
echo "__version__ = '${TAG_NAME}'[1:]" > pyfmm/_version.py
19+
20+
- name: Commit version update
21+
run: |
22+
git config user.name "github-actions[bot]"
23+
git config user.email "github-actions[bot]@users.noreply.github.com"
24+
git add pyfmm/_version.py
25+
git commit -m "Update version to ${{ github.ref_name }}"
26+
git push
27+
28+
29+
publish:
30+
runs-on: ubuntu-latest
31+
32+
permissions:
33+
id-token: write
34+
contents: read
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v3
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: "3.9"
44+
45+
- name: Install dependencies
46+
run: |
47+
pip install --upgrade setuptools wheel build
48+
49+
- name: Build the package
50+
run: |
51+
python setup.py sdist bdist_wheel
52+
53+
- name: Pypi Publish
54+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/build
2+
/dist
23
/.vscode
34
/*.egg-info
45
/docs/build

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ def read_version():
3838
exec(f.read())
3939
return locals()['__version__']
4040

41+
def read_readme():
42+
with open("README.md", encoding="utf-8") as f:
43+
return f.read()
44+
4145
setup(
42-
name='pyfmm',
46+
name='pyfmm-kit',
4347
version=read_version(),
4448
description='A C/Python package for solving eikonal equation using Fast Marching Method',
4549
author='Zhu Dengda',
4650
author_email='[email protected]',
51+
long_description=read_readme(),
52+
long_description_content_type="text/markdown",
4753
packages=find_packages(),
4854
package_data={'pyfmm': ['./C_extension/lib/libfmm_float.so', './C_extension/lib/libfmm_double.so']},
4955
include_package_data=True,

0 commit comments

Comments
 (0)