-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
release.sh
29 lines (23 loc) · 983 Bytes
/
release.sh
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
#!/bin/bash
###
# @Author: Vincent Young
# @Date: 2023-03-05 20:29:43
# @LastEditors: Vincent Young
# @LastEditTime: 2023-11-16 03:10:20
# @FilePath: /bob-plugin-deeplx/release.sh
# @Telegram: https://t.me/missuo
#
# Copyright © 2023 by Vincent, All Rights Reserved.
###
version=${1#refs/tags/v}
zip -r -j bob-plugin-deeplx-$version.bobplugin src/*
sha256_deeplx=$(sha256sum bob-plugin-deeplx-$version.bobplugin | cut -d ' ' -f 1)
echo $sha256_deeplx
download_link="https://github.com/missuo/bob-plugin-deeplx/releases/download/v$version/bob-plugin-deeplx-$version.bobplugin"
new_version="{\"version\": \"$version\", \"desc\": \"Support access token.\", \"sha256\": \"$sha256_deeplx\", \"url\": \"$download_link\", \"minBobVersion\": \"0.5.0\"}"
json_file='appcast.json'
json_data=$(cat $json_file)
updated_json=$(echo $json_data | jq --argjson new_version "$new_version" '.versions += [$new_version]')
echo $updated_json > $json_file
mkdir dist
mv *.bobplugin dist