Skip to content

Commit

Permalink
release脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
gaboolic committed Jul 21, 2024
1 parent 5196d19 commit 1f5ae4a
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 6 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: release

on:
release:
types: [published]

jobs:
generate-txt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # 你可以根据需要选择 Python 版本

- name: generate_rime_all_schema
run: |
python program/release/generate_rime_all_schema_zip.py
- name: generate_shouxin_aux.py
run: |
python program/release/generate_shouxin_aux.py
- name: generate_moqi_schema.py
run: |
python program/release/generate_moqi_schema.py
- name: generate_xh_schema.py
run: |
python program/release/generate_xh_schema.py
- name: generate_zrm_schema.py
run: |
python program/release/generate_zrm_schema.py
- name: generate_fancha_en_jp.py
run: |
python program/release/generate_fancha_en_jp_schema.py
- name: Upload rime-all
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: rime-all-schemas.zip
asset_name: rime-all-schemas.zip
asset_content_type: application/zip
upload_url: ${{ github.event.release.upload_url }}

- name: Upload shouxin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: shouxin-moqi-aux-code-for-shouxin-input-method.txt
asset_name: shouxin-moqi-aux-code-for-shouxin-input-method.txt
asset_content_type: text/plain
upload_url: ${{ github.event.release.upload_url }}

- name: Upload rime-moqi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: rime-moqi-schemas.zip
asset_name: rime-moqi-schemas.zip
asset_content_type: application/zip
upload_url: ${{ github.event.release.upload_url }}

- name: Upload rime-xh
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: rime-flypy-flypy.zip
asset_name: rime-flypy-flypy.zip
asset_content_type: application/zip
upload_url: ${{ github.event.release.upload_url }}

- name: Upload rime-zrm
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: rime-zrm-zrm.zip
asset_name: rime-zrm-zrm.zip
asset_content_type: application/zip
upload_url: ${{ github.event.release.upload_url }}

- name: Upload rime-fancha
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
asset_path: rime-reverse-and-english-and-emoji.zip
asset_name: rime-reverse-and-english-and-emoji.zip
asset_content_type: application/zip
upload_url: ${{ github.event.release.upload_url }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Project exclude paths
/venv/
/cn_dicts_dazhu/
/cn_dicts_temp/
/cn_dicts_sancang/
/cn_dicts_xh_cangjie/
sancang.dict.yaml
Expand Down Expand Up @@ -30,3 +31,6 @@ sync/
*.custom.yaml
*.custom.*
program/generate_dict_code/jdh.dict.yaml

# 压缩包
*.zip
2 changes: 1 addition & 1 deletion program/release/generate_fancha_en_jp_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def zip_folders_and_files(zip_name, folders, files):
'reverse_moqima.dict.yaml','reverse_moqima.schema.yaml',
'zrlf.dict.yaml','zrlf.schema.yaml'
]
zip_folders_and_files('反查-英语-日语等.zip', folders, files)
zip_folders_and_files('rime-reverse-and-english-and-emoji.zip', folders, files)
2 changes: 1 addition & 1 deletion program/release/generate_moqi_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def zip_folders_and_files(zip_name, folders, files):
'moqi.extended.dict.yaml',
'symbols_caps_v.yaml','rime.lua','moqi.yaml'
]
zip_folders_and_files('rime-墨奇音形全家桶(4万字支持小鹤自然码微软搜狗双拼辅).zip', folders, files)
zip_folders_and_files('rime-moqi-schemas.zip', folders, files)
2 changes: 1 addition & 1 deletion program/release/generate_rime_all_schema_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ def zip_folders_and_files(zip_name, folders, files):
print(folders)
print(files)

zip_folders_and_files('rime-所有方案全家桶.zip', folders, files)
zip_folders_and_files('rime-all-schemas.zip', folders, files)
2 changes: 1 addition & 1 deletion program/release/generate_shouxin_aux.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
line = f"{character}={encoding}"
line_list.append(line)

write_file_name = "墨奇码辅助码for手心输入法.txt"
write_file_name = "shouxin-moqi-aux-code-for-shouxin-input-method.txt"
write_file = open(write_file_name, 'w')

for line in line_list:
Expand Down
2 changes: 1 addition & 1 deletion program/release/generate_xh_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def zip_folders_and_files(zip_name, folders, files):
files = ['default.yaml', 'flypy_flypy.schema.yaml','flypy_flypy.extended.dict.yaml',
'symbols_caps_v.yaml','rime.lua','moqi.yaml'
]
zip_folders_and_files('rime-墨奇版小鹤双拼鹤形.zip', folders, files)
zip_folders_and_files('rime-flypy-flypy.zip', folders, files)
2 changes: 1 addition & 1 deletion program/release/generate_zrm_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def zip_folders_and_files(zip_name, folders, files):
files = ['default.yaml', 'zrm_zrm.schema.yaml','zrm_zrm.extended.dict.yaml',
'symbols_caps_v.yaml','rime.lua','moqi.yaml'
]
zip_folders_and_files('rime-墨奇版自然码双拼辅助码.zip', folders, files)
zip_folders_and_files('rime-zrm-zrm.zip', folders, files)

0 comments on commit 1f5ae4a

Please sign in to comment.