From 7a51d52da8276231418331e3c6b462a13c81bf6a Mon Sep 17 00:00:00 2001 From: ytsteven <1647605516@qq.com> Date: Wed, 29 Mar 2023 02:27:48 +0800 Subject: [PATCH] init commit --- .github/workflows/release.yaml | 10 +-- .gitignore | 3 +- appcast.json | 136 ++------------------------------- scripts/update_appcast.py | 8 +- scripts/update_appcast.sh | 1 + scripts/zip.sh | 1 + src/info.json | 10 +-- 7 files changed, 23 insertions(+), 146 deletions(-) create mode 100644 scripts/update_appcast.sh create mode 100644 scripts/zip.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 90cad43..d3383ae 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,7 +27,7 @@ jobs: run: sed -i -e "s/0\.1\.0/${{ steps.get_version.outputs.version-without-v }}/" src/info.json - name: Package plugin - run: mkdir release && zip -j -r release/openai-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin ./src/* + run: mkdir release && zip -j -r release/openai-translator-${{ steps.get_version.outputs.version-without-v }}.aiplugin ./src/* - run: git checkout -- src/ @@ -37,8 +37,8 @@ jobs: - name: Commit files run: | - git config --global user.name 'yetone' - git config --global user.email 'yetoneful@gmail.com' + git config --global user.name 'ytsteven' + git config --global user.email 'yt1647605516@gmail.com' git add . git commit -am 'update appcast.json' @@ -52,8 +52,8 @@ jobs: with: release_name: ${{ steps.get_version.outputs.version }} repo_token: ${{ secrets.GITHUB_TOKEN }} - file: release/openai-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin - asset_name: openai-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin + file: release/openai-translator-${{ steps.get_version.outputs.version-without-v }}.aiplugin + asset_name: openai-translator-${{ steps.get_version.outputs.version-without-v }}.aiplugin tag: ${{ github.ref }} overwrite: true body: ${{ steps.tag.outputs.message }} diff --git a/.gitignore b/.gitignore index a8b324e..41098d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.bobplugin +release +*.aiplugin diff --git a/appcast.json b/appcast.json index e35df82..341ae7e 100644 --- a/appcast.json +++ b/appcast.json @@ -1,138 +1,12 @@ { - "identifier": "yetone.openai.translator", + "identifier": "ytsteven.openai.translator", "versions": [ - { - "version": "0.2.6", - "desc": "Fix incorrect polishing result", - "sha256": "3cfbcd66d47ef41a9842d3d4e8bf156e9879842b8134f5d075aaa1cb8cc45b87", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.6/openai-translator-0.2.6.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.5", - "desc": "Improve the prompt to avoid many failed translation cases.", - "sha256": "dd846ab0e9ec23fb23fc0829174d0bb8006da60dbc2742cd09da73b3f0d54d38", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.5/openai-translator-0.2.5.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.4", - "desc": "Support specify the OpenAI domain", - "sha256": "0b46246db77c3f714b9fed703204e4d558d275805e61d6a369b94ac3a0b3461f", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.4/openai-translator-0.2.4.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.3", - "desc": "optimize: save token count", - "sha256": "31823ea32290783939ad5f69ea48137816479c127278664d741bfbc352ab2182", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.3/openai-translator-0.2.3.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.2", - "desc": "Remove Chinese quotation marks prefix and suffix.", - "sha256": "eecf1248874f3b71a5884405d17c82320e0a3770af6dafe7249bad33defb567c", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.2/openai-translator-0.2.2.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.1", - "desc": "Fixed an issue with some sentences not translating", - "sha256": "8b847e9a33b2278d6ee8894e99c767f53166ab683e075a8ea5f6b43c5de7ef1f", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.1/openai-translator-0.2.1.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.2.0", - "desc": "With the ability to use Grammarly, you can polish your sentences and correct grammar errors!", - "sha256": "ee2165c49e82ffe553c66dff732b3ff8f2e9807b6e08629bba91f0827975147b", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.2.0/openai-translator-0.2.0.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.1.4", - "desc": "Recommend gpt-3.5-turbo model", - "sha256": "56c56ff74e8902317b5554a29ecbb906f54bd0b48cc08e48d44ec3425efc7592", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.1.4/openai-translator-0.1.4.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.1.3", - "desc": "Fine-tune the prompt to eliminate unnecessary symbols in the translation result.", - "sha256": "99a41cd9cb660c0389463dde5bf3c1a3077c3d45a54eec94b48f90927902fe25", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.1.3/openai-translator-0.1.3.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.1.2", - "desc": "Support Classical Chinese to Simple Chinese", - "sha256": "61f270491fd8b46cb67ae62c7fdec8aaa8d2e5942364b9ddb051621e18caecf9", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.1.2/openai-translator-0.1.2.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.1.1", - "desc": "Fix buggy ChatGPT model detection logic", - "sha256": "a2831405a2c2e5381ef89a9af2636a396645159b8f7e40294d77c209683b4e8d", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.1.1/openai-translator-0.1.1.bobplugin", - "minBobVersion": "0.5.0" - }, { "version": "0.1.0", - "desc": "feat: support ChatGPT API!!! Please change the model to \"gpt-3.5-turbo\" or \"gpt-3.5-turbo-0301\"", - "sha256": "9f08257b46f864f514b1963f27fc240db654c355eb9bae3c25feef8b177202c4", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.1.0/openai-translator-0.1.0.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.12", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.12", - "sha256": "ce9f60c9a9282c083459af55719521cb7abd9b618681674290fe26f3d78b2b75", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.12/openai-translator-0.0.12.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.11", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.11", - "sha256": "a274fe29119ce4a5a4fb522f79f71db5a0867befd12d807a7f14d15643dc3481", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.11/openai-translator-0.0.11.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.10", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.10", - "sha256": "784c9c304a2b4b76aa6abd023dd897c29924331a9b29ecc7cadb60a18d48f8b5", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.10/openai-translator-0.0.10.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.9", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.9", - "sha256": "57e07d15a5654abf41ade482b0f76d024b371dc40de4df8cb80f3d93530b1811", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.9/openai-translator-0.0.9.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.8", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.8", - "sha256": "a5acb2971f31fd5989092ead4ed21757d409256ad5c3a0ca80d9ee1db8450a09", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.8/openai-translator-0.0.8.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.7", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.7", - "sha256": "a2738659384fde997ce222655a841ac7f2184e702a1eb7230071c7edbb4d7214", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.7/openai-translator-0.0.7.bobplugin", - "minBobVersion": "0.5.0" - }, - { - "version": "0.0.6", - "desc": "https://github.com/yetone/bob-plugin-openai-translator/releases/tag/v0.0.6", - "sha256": "979a3db1a4ebde0475a79b267f8d05f7f940f38325daabdf0cecb73030102ca6", - "url": "https://github.com/yetone/bob-plugin-openai-translator/releases/download/v0.0.6/openai-translator-0.0.6.bobplugin", - "minBobVersion": "0.5.0" + "desc": "init", + "sha256": "bc2038954f4031c520b6dca37e0b45724c9eaf7aff02ad6490077906d54f8282", + "url": "https://github.com/ytsteven/easyuseai-plugin-openai-translator/releases/download/v0.1.0/openai-translator-0.1.0.aiplugin", + "minVersion": "0.4.0" } ] } \ No newline at end of file diff --git a/scripts/update_appcast.py b/scripts/update_appcast.py index 169d67f..5b5a2ee 100644 --- a/scripts/update_appcast.py +++ b/scripts/update_appcast.py @@ -5,7 +5,7 @@ def update_appcast(version, desc): - release_file = Path(f'release/openai-translator-{version}.bobplugin') + release_file = Path(f'release/openai-translator-{version}.aiplugin') assert release_file.is_file(), 'Release file not exist' with open(release_file, 'rb') as f: c = f.read() @@ -14,15 +14,15 @@ def update_appcast(version, desc): 'version': version, 'desc': desc, 'sha256': file_hash, - 'url': f'https://github.com/yetone/bob-plugin-openai-translator/releases/download/v{version}/{release_file.name}', - 'minBobVersion': '0.5.0' + 'url': f'https://github.com/ytsteven/easyuseai-plugin-openai-translator/releases/download/v{version}/{release_file.name}', + 'minVersion': '0.4.0' } appcast_file = Path('appcast.json') if appcast_file.is_file(): with open(appcast_file, 'r') as f: appcast = json.load(f) else: - appcast = dict(identifier='yetone.openai.translator', versions=[]) + appcast = dict(identifier='ytsteven.openai.translator', versions=[]) appcast['versions'].insert(0, version_info) with open(appcast_file, 'w') as f: json.dump(appcast, f, ensure_ascii=False, indent=2) diff --git a/scripts/update_appcast.sh b/scripts/update_appcast.sh new file mode 100644 index 0000000..2666cee --- /dev/null +++ b/scripts/update_appcast.sh @@ -0,0 +1 @@ +python3 scripts/update_appcast.py 0.2.6 init \ No newline at end of file diff --git a/scripts/zip.sh b/scripts/zip.sh new file mode 100644 index 0000000..6b552df --- /dev/null +++ b/scripts/zip.sh @@ -0,0 +1 @@ +zip -j -r release/openai-translator-0.1.0.aiplugin ./src/* \ No newline at end of file diff --git a/src/info.json b/src/info.json index 440734d..3eddeec 100644 --- a/src/info.json +++ b/src/info.json @@ -1,14 +1,14 @@ { - "identifier": "yetone.openai.translator", + "identifier": "ytsteven.openai.translator", "version": "0.2.6", "category": "translate", "name": "OpenAI Translator", "summary": "GPT powered translator", "icon": "", - "author": "yetone ", - "homepage": "https://github.com/yetone/bob-plugin-openai-translator", - "appcast": "https://raw.githubusercontent.com/yetone/bob-plugin-openai-translator/main/appcast.json", - "minBobVersion": "0.5.0", + "author": "yt1647605516@gmail.com", + "homepage": "https://github.com/ytsteven/easyuseai-plugin-openai-translator", + "appcast": "https://raw.githubusercontent.com/ytsteven/easyuseai-plugin-openai-translator/main/appcast.json", + "minVersion": "0.4.0", "options": [ { "identifier": "api_url",