-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
30 lines (24 loc) · 1.07 KB
/
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
30
#!/bin/bash
###
# @Author: Vincent Young
# @Date: 2024-02-04 18:14:52
# @LastEditors: Vincent Young
# @LastEditTime: 2024-02-04 18:16:17
# @FilePath: /bob-plugin-copilot/release.sh
# @Telegram: https://t.me/missuo
#
# Copyright © 2024 by Vincent, All Rights Reserved.
###
version=${1#refs/tags/v}
zip -r -j bob-plugin-copilot-$version.bobplugin src/*
sha256_copilot=$(sha256sum bob-plugin-copilot-$version.bobplugin | cut -d ' ' -f 1)
echo $sha256_copilot
download_link="https://github.com/missuo/bob-plugin-copilot/releases/download/v$version/bob-plugin-copilot-$version.bobplugin"
new_version="{\"version\": \"$version\", \"desc\": \"None\", \"sha256\": \"$sha256_copilot\", \"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]')
updated_json=$(echo $json_data | jq --argjson new_version "$new_version" '.versions = [$new_version] + .versions')
echo $updated_json > $json_file
mkdir dist
mv *.bobplugin dist