Skip to content

Commit

Permalink
Fixed some issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekko7072 committed Mar 7, 2023
1 parent bc4bde0 commit 027faf7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 29 deletions.
Binary file modified dist/0.0.6+7/lms-0.0.6+7-macos.zip
Binary file not shown.
19 changes: 10 additions & 9 deletions dist/appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,28 @@
<sparkle:releaseNotesLink>
https://your_domain/your_path/release_notes.html
</sparkle:releaseNotesLink>
<pubDate>Mon, 6 Mar 2023 13:00:00 +0800</pubDate>
<enclosure url="0.0.5+6/lms-0.0.5+6-macos.zip"
sparkle:edSignature="xKL+Dqgea7dUK9xBUcG5NqC4pKmX3bo2IeEbu7QGc7XEsY8kUlM1bVsingQJij63aCLuTn0CPZc54wd+xZJ8Aw=="
length="60473350"
sparkle:version="0.0.5"
<pubDate>Mon, 7 Mar 2023 13:00:00 +0800</pubDate>
<enclosure url="0.0.6+7/lms0.0.6+7-macos.zip"
sparkle:edSignature="zjwwtCLwfHHWVInjXrQJE7/qa8Vz2DfgtqXEoh97BcimLp/uBlKDOzh91BN7IMv6LxcAiJJ1xuHSwky5yN8bDg=="
length="60472476"
sparkle:version="0.0.6"
sparkle:os="macos"
type="application/octet-stream" />
</item>
<!--macOS_end-->

<!--windows_start-->
<item>
<title>Version 0.0.4</title>
<sparkle:releaseNotesLink>
https://your_domain/your_path/release_notes.html
</sparkle:releaseNotesLink>
<pubDate>Mon, 6 Mar 2023 12:00:00 +0800</pubDate>
<enclosure url="1.1.0+2/auto_updater_example-1.1.0+2-windows.exe"
sparkle:dsaSignature="MEUCIQCVbVzVID7H3aUzAY5znpi+ySZKznkukV8whlMFzKh66AIgREUGOmvavlcg6hwAwkb2o4IqVE/D56ipIBshIqCH8rk="
sparkle:version="1.1.0"
sparkle:os="windows"
<enclosure url="0.0.6+7/lms0.0.6+7-windows.exe"
sparkle:dsaSignature=""
length="0"
sparkle:version="0.0.6"
sparkle:os="windows"
type="application/octet-stream" />
</item>
<!--windows_end-->
Expand Down
34 changes: 27 additions & 7 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

echo

# Ask user to insert the version number matching in pubspec.yaml
read -p "Insert number of release from pubspec.yaml: " release_version

# Ask user to choose between macOS or Windows
echo "Possible platform to release:"
Expand Down Expand Up @@ -35,14 +33,36 @@ if [ "$release_choice" == "0" ]; then
echo "Signature: $signature"
echo "Length: $length"

# Define the replacement text
replacement_text="<item>\n<title>Version $release_version</title>\n<sparkle:releaseNotesLink>\nhttps://your_domain/your_path/release_notes.html\n</sparkle:releaseNotesLink>\n<pubDate>Mon, 6 Mar 2023 13:00:00 +0800</pubDate>\n<enclosure url=\"$output\"\nsparkle:edSignature=\"$signature\"\nlength=\"$length\"\nsparkle:version=\"$release_version\"\nsparkle:os=\"macos\"\ntype=\"application/octet-stream\" />\n</item>"
echo "Update appcast.xml macos"

# Use sed to replace the text between the <!--macOS_start--> and <!--macOS_end--> comments with the replacement text
sed -i '' '/<!--macOS_start-->/,/<\!--macOS_end-->/c\'"$replacement_text"'' dist/appcast.xml

elif [ "$release_choice" == "1" ]; then
flutter_distributor release --name dev --jobs release-windows

# 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
Expand Down
13 changes: 0 additions & 13 deletions test.sh

This file was deleted.

0 comments on commit 027faf7

Please sign in to comment.