Skip to content

Commit f3fd5e4

Browse files
committed
update publish to pypi
1 parent b5e9216 commit f3fd5e4

File tree

6 files changed

+50
-9
lines changed

6 files changed

+50
-9
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
version=0.0.5a0
1+
version=0.0.4a0
22

33
prepare:
4-
pip install twine
4+
pip install -r requirements.txt
55

66
clean:
77
rm -rf ./dist

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ print(memo.tags)
3535

3636
如有疑问,欢迎 issue。
3737

38+
## Local Install 本地安装
39+
40+
```shell
41+
git clone https://github.com/Benature/flomo.git
42+
make all
43+
```
44+
3845

3946
## Relative Project 相关项目
4047

flomo/.github/workflows/ci-cd.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
env:
8+
PYPI_PROJECT_NAME: flomo
9+
jobs:
10+
pypi-publish:
11+
name: Upload release to PyPI
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/${{env.PYPI_PROJECT_NAME}}
16+
permissions:
17+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
18+
steps:
19+
# retrieve your distributions here
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel twine
24+
- name: Build package
25+
run: python setup.py sdist bdist_wheel
26+
27+
# - name: Publish package distributions to PyPI
28+
# uses: pypa/gh-action-pypi-publish@release/v1
29+
- name: Build and publish
30+
env:
31+
TWINE_USERNAME: __token__
32+
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
33+
run: |
34+
twine upload dist/*

flomo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.0.5-alpha'
1+
__version__ = '0.0.4-alpha'
22

33
import platform
44
import requests

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
requests
22
bs4
3+
twine

setup.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding:utf-8 -*-
22
import setuptools
3-
import pathlib
43
import ast
5-
import typing as ty
4+
from pathlib import Path
5+
from typing import List
66

77
REQUIREMENTS_SPEC = 'requirements.txt'
88
PACKAGE_ENTRY = 'flomo'
@@ -12,8 +12,8 @@
1212
long_description = fh.read()
1313

1414

15-
def read_requirements() -> ty.List[str]:
16-
p = pathlib.Path(__file__).parent / REQUIREMENTS_SPEC
15+
def read_requirements() -> List[str]:
16+
p = Path(__file__).parent / REQUIREMENTS_SPEC
1717
with open(str(p), 'r', encoding='utf-8') as f:
1818
rows = f.readlines()
1919

@@ -32,7 +32,7 @@ def read_requirements() -> ty.List[str]:
3232

3333

3434
def get_version() -> str:
35-
p = pathlib.Path(__file__).parent / PACKAGE_ENTRY / '__init__.py'
35+
p = Path(__file__).parent / PACKAGE_ENTRY / '__init__.py'
3636

3737
version_row = None
3838
with open(str(p), 'r', encoding='utf-8') as f:
@@ -74,7 +74,6 @@ def get_version() -> str:
7474
),
7575
python_requires='>=3.7',
7676
)
77-
7877
'''
7978
pip uninstall flomo -y
8079
rm -rf ./dist

0 commit comments

Comments
 (0)