Skip to content

Commit

Permalink
Update appcast path
Browse files Browse the repository at this point in the history
Update 修复打包不正确的问题

Update 修复打包不正确的问题

Update 修复打包不正确的问题

Update Github Workflow
  • Loading branch information
almighty.yantao committed Jul 20, 2024
1 parent 957597f commit a11b5c2
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 57 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/compress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
# Ignore the push event if commit message contains "[skip ci]"
paths-ignore:
- 'src/appcast.json'
- 'appcast.json'

jobs:
zip:
Expand All @@ -28,7 +28,8 @@ jobs:

- name: Zip src directory
run: |
zip -r src.zip src
cd src && zip -r src.zip . -x ".*" -x "*/.*" -x "*/*/.*" -x "*/*/*/.*" -x "src.zip"
mv src.zip ../
working-directory: ${{ github.workspace }}

- name: Calculate SHA256
Expand All @@ -39,13 +40,13 @@ jobs:
- name: Read appcast.json
id: read_appcast
run: |
echo ::set-output name=appcast::$(cat src/appcast.json)
echo ::set-output name=appcast::$(cat appcast.json)
working-directory: ${{ github.workspace }}

- name: Determine next version
id: next_version
run: |
versions=$(jq '.versions[].version' src/appcast.json)
versions=$(jq '.versions[].version' appcast.json)
if [ -z "$versions" ]; then
versions="0.0.0"
fi
Expand All @@ -72,6 +73,15 @@ jobs:
echo "::set-output name=next_version::$new_version"
shell: bash
working-directory: ${{ github.workspace }}

- name: Get Info.json Version
id: get_info_version
run: |
version=$(jq -r '.version' src/info.json)
echo "Version: $version"
echo "::set-output name=version::$version"
shell: bash
working-directory: ${{ github.workspace }}

- name: Get commit message
id: commit_message
Expand Down Expand Up @@ -99,13 +109,18 @@ jobs:
}'
# Read the current appcast.json
current_appcast=$(cat src/appcast.json)
current_appcast=$(cat appcast.json)
# Append the new version object to the versions array
new_appcast=$(jq --argjson new_version "$new_version" '.versions += [$new_version]' <<< "$current_appcast")
# Update appcast.json with the new versions array
echo "$new_appcast" > src/appcast.json
echo "$new_appcast" > appcast.json
working-directory: ${{ github.workspace }}

- name: Modify src/info.json
run: |
jq --arg new_version "${{ steps.next_version.outputs.next_version }}" '.version = $new_version' src/info.json > tmp.$$.json && mv tmp.$$.json src/info.json
working-directory: ${{ github.workspace }}

- name: Create Release
Expand All @@ -114,7 +129,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
tag_name: v${{ github.run_number }}
tag_name: ${{ steps.next_version.outputs.next_version }}
release_name: ${{ steps.build.outputs.build }}.bobplugin ${{ steps.next_version.outputs.next_version }}
body: |
- Added ${{ steps.build.outputs.build }}.bobplugin
Expand Down
Binary file removed bob-plugin-deeplx-translator.bobplugin
Binary file not shown.
100 changes: 50 additions & 50 deletions src/info.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
{
"identifier": "yantao.deeplx.bob",
"version": "0.1.1",
"category": "translate",
"name": "DeepLx 翻译插件",
"summary": "DeepLx 翻译插件",
"icon": "115",
"author": "yantao",
"homepage": "https://yantao.wiki",
"appcast": "https://raw.githubusercontent.com/almightyYantao/bob-plugin-deeplx-translator/main/appcast.json",
"minBobVersion": "0.5.0",
"options": [
"identifier": "yantao.deeplx.bob",
"version": "0.0.2",
"category": "translate",
"name": "DeepLx 翻译插件",
"summary": "DeepLx 翻译插件",
"icon": "115",
"author": "yantao",
"homepage": "https://yantao.wiki",
"appcast": "https://raw.githubusercontent.com/almightyYantao/bob-plugin-deeplx-translator/main/appcast.json",
"minBobVersion": "0.5.0",
"options": [
{
"identifier": "key",
"type": "text",
"desc": "申请地址:https://linux.do/t/topic/111737",
"title": "Key"
},
{
"identifier": "apiMenu",
"type": "menu",
"title": "API类型",
"defaultValue": "1",
"menuValues": [
{
"identifier": "key",
"type": "text",
"desc": "申请地址:https://linux.do/t/topic/111737",
"title": "Key"
"title": "内置API-Linux.Do",
"value": "1"
},
{
"identifier": "apiMenu",
"type": "menu",
"title": "API类型",
"defaultValue": "1",
"menuValues": [
{
"title": "内置API-Linux.Do",
"value": "1"
},
{
"title": "自定义API",
"value": "2"
}
]
},
"title": "自定义API",
"value": "2"
}
]
},
{
"identifier": "customUrl",
"type": "text",
"title": "自定义API地址",
"desc": "请填写完成的地址:https://api.deeplx.org/key/translate\n需要带上Key,否则的话将失效"
},
{
"identifier": "alternatives",
"type": "menu",
"title": "是否启用Alternatives",
"defaultValue": "1",
"menuValues": [
{
"identifier": "customUrl",
"type": "text",
"title": "自定义API地址",
"desc": "请填写完成的地址:https://api.deeplx.org/key/translate\n需要带上Key,否则的话将失效"
"title": "启用",
"value": "1"
},
{
"identifier": "alternatives",
"type": "menu",
"title": "是否启用Alternatives",
"defaultValue": "1",
"menuValues": [
{
"title": "启用",
"value": "1"
},
{
"title": "禁用",
"value": "2"
}
]
"title": "禁用",
"value": "2"
}
]
}
]
}
]
}

0 comments on commit a11b5c2

Please sign in to comment.