Fix ci scripts

This commit is contained in:
niuhuan 2022-06-03 14:58:25 +08:00
parent 97b26dbca5
commit 7024ab280a
4 changed files with 36 additions and 9 deletions

View File

@ -215,6 +215,19 @@ jobs:
cd ci
cp version.code.txt ../lib/assets/version.txt
- name: Upgrade deps version (Android)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host != 'macos-latest' && startsWith(matrix.config.flutter_version, '3')
run: |
sed -i "s/another_xlider: 1.0.1+2/another_xlider: ^1.0.1+2/g" pubspec.yaml
sed -i "s/flutter_styled_toast: 2.0.0/flutter_styled_toast: ^2.0.0/g" pubspec.yaml
- name: Upgrade deps version (iOS)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.host == 'macos-latest' && startsWith(matrix.config.flutter_version, '3')
run: |
brew install gnu-sed
gsed -i "s/another_xlider: 1.0.1+2/another_xlider: ^1.0.1+2/g" pubspec.yaml
gsed -i "s/flutter_styled_toast: 2.0.0/flutter_styled_toast: ^2.0.0/g" pubspec.yaml
- name: Build (windows)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.target == 'windows'
run: |
@ -276,9 +289,11 @@ jobs:
go run ./cmd/upload_asset
send_to_community:
name: CI is green
needs:
- check_release
- build_release_assets
name: Send message to community
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

View File

@ -2,6 +2,7 @@ package main
import (
"ci/commons"
"context"
"encoding/json"
"fmt"
"github.com/andersfylling/disgord"
@ -50,7 +51,7 @@ func main() {
var discordChatIds []uint64
json.Unmarshal([]byte(discordChatIdsStr), &discordChatIds)
if len(discordChatIds) > 0 {
sendMessageToDiscord(tgToken, discordChatIds, message)
sendMessageToDiscord(discordToken, discordChatIds, message)
}
}
}
@ -72,11 +73,15 @@ func sendMessageToTg(token string, ids []int64, message string) {
}
func sendMessageToDiscord(token string, ids []uint64, message string) {
client := disgord.New(disgord.Config{
client, err := disgord.NewClient(context.Background(), disgord.Config{
BotToken: token,
})
if err != nil {
fmt.Sprintf("discord login failed : %v", err.Error())
return
}
for _, id := range ids {
_, err := client.SendMsg(disgord.Snowflake(id), message)
_, err = client.SendMsg(disgord.Snowflake(id), message)
if err != nil {
fmt.Sprintf("Send message to tg chat : %v (error : %v)", id, err.Error())
} else {

View File

@ -7,7 +7,7 @@ packages:
name: another_xlider
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.0.1+2"
archive:
dependency: transitive
description:
@ -164,7 +164,7 @@ packages:
name: flutter_styled_toast
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.0"
flutter_svg:
dependency: "direct main"
description:
@ -329,6 +329,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
permission_handler:
dependency: "direct main"
description:

View File

@ -32,8 +32,8 @@ dependencies:
event: ^2.0.5
flutter_search_bar: ^3.0.0-dev.1
flutter_svg: ^1.0.3
flutter_styled_toast: ^2.1.3
another_xlider: ^1.1.0
flutter_styled_toast: 2.0.0
another_xlider: 1.0.1+2
scrollable_positioned_list: ^0.2.0-nullsafety.0
permission_handler: ^8.3.0
url_launcher: ^6.0.9