Skip to content

Commit

Permalink
fix: appcast
Browse files Browse the repository at this point in the history
  • Loading branch information
rhinoc committed Feb 10, 2024
1 parent fcf8b67 commit 9d8497d
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 77 deletions.
26 changes: 0 additions & 26 deletions appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,5 @@
<title>liltr</title>
<language>en</language>

<item>
<title>Version 0.0.3</title>
<pubDate>Sat, 10 Feb 2024 09:02:06 +0000</pubDate>
<sparkle:minimumSystemVersion>14.0;</sparkle:minimumSystemVersion>
<enclosure
url="https://github.com/rhinoc/liltr/releases/download/v0.0.3/liltr 0.0.3.dmg"
sparkle:version="0.0.3"
sparkle:shortVersionString="0.0.3"
sparkle:edSignature="uaMMyBDmN6t/6ShVJUIa7tSYeZHIa1N5DkrMgMDDokwLxdvKLhu+fezpZZ6zGLtD5Zs3BJxs5ZQu7XJAapm0AA==" length="5527856"
type="application/octet-stream"/>
</item>


<item>
<title>Version 0.0.2</title>
<pubDate>Sat, 10 Feb 2024 08:12:00 +0000</pubDate>
<sparkle:minimumSystemVersion>14.0;</sparkle:minimumSystemVersion>
<enclosure
url="https://github.com/rhinoc/liltr/releases/download/v0.0.2/liltr 0.0.2.dmg"
sparkle:version="0.0.2"
sparkle:shortVersionString="0.0.2"
sparkle:edSignature="wTKjDl1dlxq1b+/kNxQyjYxKw2M7Ro0btOw+Y2GbqM795Qpfip5d5bz352gZBIMJlTimpuM0J2sMJ+X6QwTFAw==" length="5527396"
type="application/octet-stream"/>
</item>


</channel>
</rss>
6 changes: 4 additions & 2 deletions liltr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,14 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0.0.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = H6N2N99XF5;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = liltr/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = liltr;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -606,13 +607,14 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0.0.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = H6N2N99XF5;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = liltr/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = liltr;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
78 changes: 40 additions & 38 deletions liltr/Info.plist
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>APP_NAME</key>
<string>liltr</string>
<key>AliAK</key>
<string></string>
<key>AliSK</key>
<string></string>
<key>BaiduAK</key>
<string></string>
<key>BaiduSK</key>
<string></string>
<key>BigHugeThesaurusSK</key>
<string></string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.rhinoc.liltr</string>
<key>CFBundleURLSchemes</key>
<array>
<string>liltr</string>
</array>
</dict>
</array>
<key>NiuTransSK</key>
<string></string>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/rhinoc/liltr/main/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>jhRLvU+V5Vdg0XzLT8BD/ogDVcRh33w2cR8Ri7xGrCk=</string>
<key>VERSION</key>
<string>0.0.3</string>
<key>VolcengineAK</key>
<string></string>
<key>VolcengineSK</key>
<string></string>
</dict>
</plist>
<dict>
<key>APP_NAME</key>
<string>liltr</string>
<key>AliAK</key>
<string></string>
<key>AliSK</key>
<string></string>
<key>BaiduAK</key>
<string></string>
<key>BaiduSK</key>
<string></string>
<key>BigHugeThesaurusSK</key>
<string></string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.rhinoc.liltr</string>
<key>CFBundleURLSchemes</key>
<array>
<string>liltr</string>
</array>
</dict>
</array>
<key>NiuTransSK</key>
<string></string>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/rhinoc/liltr/main/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>jhRLvU+V5Vdg0XzLT8BD/ogDVcRh33w2cR8Ri7xGrCk=</string>
<key>VolcengineAK</key>
<string></string>
<key>VolcengineSK</key>
<string></string>
<key>CFBundleVersion</key>
<string>0.0.3</string>
<key>CFBundleShortVersionString</key>
<string>0.0.3</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion liltr/Settings/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct AboutView: View {
.foregroundStyle(.primary)

VStack(alignment: .leading) {
Text("Version \(Bundle.main.infoDictionary!["VERSION"] as! String)")
Text("Version \(Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String)")
.foregroundStyle(.primary)
Spacer()
Text("© rhinoc")
Expand Down
13 changes: 6 additions & 7 deletions scripts/update_appcast.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/usr/bin/env bash

set -exu

minimumSystemVersion="$(awk -F ' = ' '/MACOSX_DEPLOYMENT_TARGET/ { print $2; exit }' < $PROJECT_PATH)"
zipName="$APP_NAME $VERSION.dmg"
edSignatureAndLength=$(scripts/sign_update -s $SPARKLE_ED_PRIVATE_KEY "$XCODE_BUILD_PATH/$zipName")
minimumSystemVersion="$(awk -F ' = ' '/MACOSX_DEPLOYMENT_TARGET/ { print substr($2, 1, length($2) - 1); exit }' < $PROJECT_PATH)"
dmgName="$APP_NAME $VERSION.dmg"
githubDmgName="$APP_NAME.$VERSION.dmg"
edSignatureAndLength=$(scripts/sign_update -s $SPARKLE_ED_PRIVATE_KEY "$XCODE_BUILD_PATH/$dmgName")
date="$(date +'%a, %d %b %Y %H:%M:%S %z')"

echo "
<item>
<title>Version $VERSION</title>
<sparkle:version>$VERSION</sparkle:version>
<pubDate>$date</pubDate>
<sparkle:minimumSystemVersion>$minimumSystemVersion</sparkle:minimumSystemVersion>
<enclosure
url=\"https://github.com/rhinoc/liltr/releases/download/v$VERSION/$zipName\"
sparkle:version=\"$VERSION\"
sparkle:shortVersionString=\"$VERSION\"
url=\"https://github.com/rhinoc/liltr/releases/download/v$VERSION/$githubDmgName\"
$edSignatureAndLength
type=\"application/octet-stream\"/>
</item>
Expand Down
7 changes: 4 additions & 3 deletions scripts/update_version.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
set -exu

# get old version
PREV_VERSION=$(/usr/libexec/PlistBuddy -c "Print VERSION" "$INFO_PLIST_PATH")
PREV_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFO_PLIST_PATH")

# get new version
NEXT_VERSION=$(npx semver -i patch $PREV_VERSION)

# update info.plist
/usr/libexec/PlistBuddy -c "Set :VERSION $NEXT_VERSION" "$INFO_PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $NEXT_VERSION" "$INFO_PLIST_PATH"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $NEXT_VERSION" "$INFO_PLIST_PATH"
sed -i '' -e "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${NEXT_VERSION};/" liltr.xcodeproj/project.pbxproj

sed -i '' -e "s/CURRENT_PROJECT_VERSION = .*;/CURRENT_PROJECT_VERSION = ${NEXT_VERSION};/" liltr.xcodeproj/project.pbxproj
echo $NEXT_VERSION

0 comments on commit 9d8497d

Please sign in to comment.