-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
72 lines (49 loc) · 2.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
echo
# Ask user to choose between macOS or Windows
echo "Possible platform to release:"
echo "+ 0: macOS"
echo "+ 1: Windows"
# Prompt the user to choose between macOS or Windows
read -p "Select platform: " release_choice
if [ "$release_choice" == "0" ]; then
# Print what you will run
echo "flutter_distributor release --name dev --jobs release-macos"
# Run the command and store the output in the variable
url=$(flutter_distributor release --name dev --jobs release-macos | grep -o "dist/.*\.zip")
# Print the value of the variable
echo "BUILD PATH: $url"
# Sign code
echo "flutter pub run auto_updater:sign_update $url"
output=$(flutter pub run auto_updater:sign_update "$url")
echo "$output"
# Get variables of signed and length
signature=$(echo "$output" | grep -o 'sparkle:edSignature="[a-zA-Z0-9+/]*=="' | awk -F'"' '{print $2}')
length=$(echo "$output" | grep -o 'length="[0-9]*"' | awk -F'"' '{print $2}')
echo "Signature: $signature"
echo "Length: $length"
echo "Update appcast.xml macos"
elif [ "$release_choice" == "1" ]; then
# Print what you will run
echo "flutter_distributor release --name dev --jobs release-windows"
# Run the command and store the output in the variable
url=$(flutter_distributor release --name dev --jobs release-windows | grep -o "dist/.*\.zip")
# Print the value of the variable
echo "BUILD PATH: $url"
# Sign code
echo "flutter pub run auto_updater:sign_update $url"
output=$(flutter pub run auto_updater:sign_update "$url")
echo "$output"
# Get variables of signed and length
signature=$(echo "$output" | grep -o 'sparkle:edSignature="[a-zA-Z0-9+/]*=="' | awk -F'"' '{print $2}')
length=$(echo "$output" | grep -o 'length="[0-9]*"' | awk -F'"' '{print $2}')
echo "Signature: $signature"
echo "Length: $length"
echo "Update appcast.xml windows"
echo "Then run npm run deploy"
else
echo "Invalid release choice. Please choose between 'macOS' or 'Windows'."
exit 1
fi
# Deploy to Firebase
#firebase deploya