54
54
GCM_SENDER_ID : ${{ secrets.GCM_SENDER_ID }}
55
55
run : |
56
56
./setup.sh
57
+ - name : Restore Build Cache
58
+ uses : actions/cache@v3
59
+ with :
60
+ path : build
61
+ key : build-cache-${{ runner.os }}-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('**/Package.resolved') }}
62
+ restore-keys : |
63
+ build-cache-${{ runner.os }}-${{ matrix.os }}-${{ matrix.arch }}-
57
64
- name : Archive
58
65
run : |
59
66
xcodebuild clean archive \
63
70
-destination "platform=macOS"
64
71
mkdir -p build/Build/Products/Release
65
72
cp -R build/mpvx.xcarchive/Products/Applications/mpvx.app build/Build/Products/Release/mpvx.app
73
+ - name : Save Build Cache
74
+ uses : actions/cache@v3
75
+ with :
76
+ path : build
77
+ key : build-cache-${{ runner.os }}-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles('**/Package.resolved') }}
66
78
- name : Install create-dmg
67
79
run : |
68
80
brew install create-dmg
@@ -78,24 +90,28 @@ jobs:
78
90
--icon "mpvx.app" 200 200 \
79
91
./dist/mpvx.dmg \
80
92
./build/Build/Products/Release/mpvx.app
81
- - name : Download latest Sparkle CLI
93
+ - name : Download Sparkle CLI (version from Package.resolved)
82
94
run : |
83
- # wget ${GITHUB_API_URL}/repos/sparkle-project/Sparkle/releases/latest -O sparkle.json
84
- # cat sparkle.json | jq
85
- # DOWNLOAD_URL=`cat sparkle.json | jq -r '.assets[] | select(.name == "Sparkle-for-Swift-Package-Manager.zip").browser_download_url'`
86
- # if [ -z "$DOWNLOAD_URL" ]; then
87
- # echo "Error: Could not find a Sparkle-for-Swift-Package-Manager.zip asset in the latest Sparkle release."
88
- # exit 1
89
- # fi
90
- # Workaround: Use a fixed version of Sparkle CLI for now to fix API rate limit issue
91
- DOWNLOAD_URL="https://github.com/sparkle-project/Sparkle/releases/download/2.6.4/Sparkle-for-Swift-Package-Manager.zip"
95
+ # Extract Sparkle version from Package.resolved
96
+ SPARKLE_VERSION=$(jq -r '.pins[] | select(.identity == "sparkle") | .state.version' \
97
+ mpvx.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
98
+ if [ -z "$SPARKLE_VERSION" ]; then
99
+ echo "Error: Could not determine Sparkle version from Package.resolved."
100
+ exit 1
101
+ fi
102
+ echo "Detected Sparkle version: $SPARKLE_VERSION"
103
+ # Construct download URL
104
+ DOWNLOAD_URL="https://github.com/sparkle-project/Sparkle/releases/download/${SPARKLE_VERSION}/Sparkle-for-Swift-Package-Manager.zip"
92
105
echo "Downloading Sparkle CLI from \`${DOWNLOAD_URL}\`..."
106
+ # Download and unzip Sparkle CLI
93
107
wget -O /tmp/Sparkle-for-Swift-Package-Manager.zip "${DOWNLOAD_URL}"
94
108
echo "Unzipping Sparkle CLI to \`/tmp/sparkle\`..."
95
109
unzip /tmp/Sparkle-for-Swift-Package-Manager.zip -d /tmp/sparkle
110
+ # Make CLI tools executable
96
111
echo "Making CLI tools executable..."
97
112
chmod +x /tmp/sparkle/bin/generate_appcast
98
113
chmod +x /tmp/sparkle/bin/sign_update
114
+ # Copy CLI tools to the workspace
99
115
echo "Copying CLI tools to \`${GITHUB_WORKSPACE}\`..."
100
116
cp /tmp/sparkle/bin/generate_appcast $GITHUB_WORKSPACE/
101
117
cp /tmp/sparkle/bin/sign_update $GITHUB_WORKSPACE/
0 commit comments