Skip to content

Commit d3b7138

Browse files
authored
update script (#74)
1 parent e72eeea commit d3b7138

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Tools/*.dmg
22
.DS_Store
3+
Tools/build

Tools/build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ codesign -vvv --deep --strict $APP_PATH/Products/Applications/NeewerLite.app
6464
./package_and_build_appcast.sh ./build/NeewerLite.xcarchive/Products/Applications/
6565

6666
xcrun notarytool submit "NeewerLite.dmg" --keychain-profile "AC_PASSWORD" --wait
67-
6867
xcrun stapler staple NeewerLite.dmg
69-
7068
stapler validate NeewerLite.dmg
7169

7270
#

Tools/publish.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
#!/bin/bash
22

3+
# GitHub release metadata
4+
REPO_OWNER="keefo"
5+
REPO_NAME="NeewerLite"
6+
TAG_NAME="v$(date +%Y.%m.%d.%H%M)"
7+
RELEASE_NAME="Release $TAG_NAME"
8+
RELEASE_BODY="Auto release uploaded by publish script."
9+
310
BUILD_DIR="./build/NeewerLite.xcarchive/Products/Applications/"
411
DMG_FILENAME=NeewerLite
12+
APP_PATH="${BUILD_DIR}/${DMG_FILENAME}.app"
13+
ZIP_PATH="${BUILD_DIR}/${DMG_FILENAME}.zip"
514

15+
# 1. Verify environment variables
616
if [ -z "$NEEWERLITE_REMOTE_FOLDER" ]
717
then
818
echo "\$NEEWERLITE_REMOTE_FOLDER is empty"
@@ -15,13 +25,30 @@ then
1525
exit 1
1626
fi
1727

18-
echo 'replace download path'
28+
# 2. Extract version from Info.plist
29+
VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${APP_PATH}/Contents/Info.plist")
30+
TAG_NAME="v$VERSION"
31+
RELEASE_TITLE="$TAG_NAME"
1932

20-
sed -i '' -e "s/NeewerLite.zip/download\/NeewerLite.zip/" "${BUILD_DIR}/appcast.xml"
33+
echo "Publishing release: $RELEASE_TITLE"
34+
echo "Using tag: $TAG_NAME"
2135

22-
echo "Upload the appcast"
36+
# 3. Replace download path in appcast
37+
echo 'replace download path'
38+
sed -i '' -e "s/NeewerLite.zip/download\/NeewerLite.zip/" "${BUILD_DIR}/appcast.xml"
2339

40+
# 4. Upload to your website
41+
echo "Uploading appcast to $NEEWERLITE_REMOTE_USER_NAME:$NEEWERLITE_REMOTE_FOLDER..."
2442
ssh $NEEWERLITE_REMOTE_USER_NAME "rm $NEEWERLITE_REMOTE_FOLDER/appcast.xml"
25-
2643
scp "${BUILD_DIR}/appcast.xml" $NEEWERLITE_REMOTE_USER_NAME:$NEEWERLITE_REMOTE_FOLDER/
27-
scp "${BUILD_DIR}/${DMG_FILENAME}.zip" $NEEWERLITE_REMOTE_USER_NAME:$NEEWERLITE_REMOTE_FOLDER/download/
44+
scp "${ZIP_PATH}" $NEEWERLITE_REMOTE_USER_NAME:$NEEWERLITE_REMOTE_FOLDER/download/
45+
46+
# 5. Upload to GitHub release
47+
echo "Creating GitHub release for $TAG_NAME..."
48+
49+
gh release create "$TAG_NAME" "$ZIP_PATH" \
50+
--repo "keefo/NeewerLite" \
51+
--title "$RELEASE_TITLE" \
52+
--notes "Auto-generated release for $RELEASE_TITLE"
53+
54+
echo "✅ Release $TAG_NAME published to GitHub and website."

0 commit comments

Comments
 (0)