-
-
Notifications
You must be signed in to change notification settings - Fork 4
74 lines (68 loc) · 4.56 KB
/
python-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Prepare files
run: |
mkdir FeishuBitableAPI
cp *.py FeishuBitableAPI/
- name: Modify import statements
run: |
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_APP_ACCESS_TOKEN/from .GET_APP_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_FIELD_INFO/from .GET_FIELD_INFO/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_INFO_FROM_URL/from .GET_INFO_FROM_URL/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_LOGIN_CODE/from .GET_LOGIN_CODE/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_RECORD_ID/from .GET_RECORD_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_RECORD/from .GET_RECORD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_TABLE_ID/from .GET_TABLE_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_TENANT_ACCESS_TOKEN/from .GET_TENANT_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_USER_ACCESS_TOKEN/from .GET_USER_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from GET_VIEW_ID/from .GET_VIEW_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from LIST_FIELDS/from .LIST_FIELDS/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from LIST_RECORDS/from .LIST_RECORDS/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from LIST_TABLES/from .LIST_TABLES/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from LIST_VIEWS/from .LIST_VIEWS/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from REFRESH_USER_ACCESS_TOKEN/from .REFRESH_USER_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_APP_ACCESS_TOKEN/from .WRITE_APP_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_FIELD_INFO/from .WRITE_FIELD_INFO/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_INFO_FROM_URL/from .WRITE_INFO_FROM_URL/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_LOGIN_CODE/from .WRITE_LOGIN_CODE/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_RECORD_ID/from .WRITE_RECORD_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_TABLE_ID/from .WRITE_TABLE_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_TENANT_ACCESS_TOKEN/from .WRITE_TENANT_ACCESS_TOKEN/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from WRITE_VIEW_ID/from .WRITE_VIEW_ID/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from CREATE_FIELD/from .CREATE_FIELD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from CREATE_TABLE/from .CREATE_TABLE/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from CHECK_FIELD_EXIST/from .CHECK_FIELD_EXIST/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from CHECK_FIELD_EXIST_SQL/from .CHECK_FIELD_EXIST_SQL/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from DELETE_FIELDS/from .DELETE_FIELDS/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from DELETE_RECORD/from .DELETE_RECORD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from BUILD_FIELD/from .BUILD_FIELD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from UPDATE_FIELD/from .UPDATE_FIELD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from UPDATE_RECORD/from .UPDATE_RECORD/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from ADD_RECORDS_FROM_CSV/from .ADD_RECORDS_FROM_CSV/g' {} \;
find FeishuBitableAPI -name "*.py" -exec sed -i 's/from CONVERSION_FIELDS/from .CONVERSION_FIELDS/g' {} \;
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Clean up
run: rm -rf FeishuBitableAPI