@@ -92,28 +92,19 @@ jobs:
9292 - name : Prepare artifacts (Linux/macOS)
9393 if : runner.os != 'Windows'
9494 run : |
95- mkdir -p prepared -artifacts
95+ mkdir -p release -artifacts
9696
97- # Handle Linux - move installers and yml (rename yml to include arch)
97+ # Handle Linux - move installers only
9898 if [[ "${{ matrix.target }}" == "linux" ]]; then
9999 if compgen -G "release-builds/*.AppImage" > /dev/null; then
100- mv release-builds/*.AppImage prepared-artifacts/
101- fi
102- if compgen -G "release-builds/*.snap" > /dev/null; then
103- mv release-builds/*.snap prepared-artifacts/
104- fi
105- if [ -f "release-builds/latest-linux.yml" ]; then
106- mv release-builds/latest-linux.yml "prepared-artifacts/latest-linux-${{ matrix.arch }}.yml"
100+ mv release-builds/*.AppImage release-artifacts/
107101 fi
108102 fi
109103
110- # Handle macOS - move installers and yml (rename yml to include arch)
104+ # Handle macOS - move installers only
111105 if [[ "${{ matrix.target }}" == "mac" ]]; then
112106 if compgen -G "release-builds/*.dmg" > /dev/null; then
113- mv release-builds/*.dmg prepared-artifacts/
114- fi
115- if [ -f "release-builds/latest-mac.yml" ]; then
116- mv release-builds/latest-mac.yml "prepared-artifacts/latest-mac-${{ matrix.arch }}.yml"
107+ mv release-builds/*.dmg release-artifacts/
117108 fi
118109 fi
119110 shell : bash
@@ -122,32 +113,11 @@ jobs:
122113 if : runner.os == 'Windows'
123114 shell : pwsh
124115 run : |
125- New-Item -ItemType Directory -Force -Path prepared -artifacts | Out-Null
116+ New-Item -ItemType Directory -Force -Path release -artifacts | Out-Null
126117
127- # Move .exe installer files
118+ # Move .exe installer files only
128119 Get-ChildItem -Path "release-builds" -Filter "*.exe" | ForEach-Object {
129- Move-Item $_.FullName -Destination "prepared-artifacts/" -Force
130- }
131- # Move latest.yml for auto-updates (rename to include arch)
132- if (Test-Path "release-builds/latest.yml") {
133- Move-Item "release-builds/latest.yml" -Destination "prepared-artifacts/latest-${{ matrix.arch }}.yml" -Force
134- }
135-
136- - name : Move artifacts to release directory (Linux/macOS)
137- if : runner.os != 'Windows'
138- run : |
139- mkdir -p release-artifacts
140- if [ -d prepared-artifacts ] && [ "$(ls -A prepared-artifacts 2>/dev/null)" ]; then
141- mv prepared-artifacts/* release-artifacts/ || true
142- fi
143-
144- - name : Move artifacts to release directory (Windows)
145- if : runner.os == 'Windows'
146- shell : pwsh
147- run : |
148- New-Item -ItemType Directory -Force -Path release-artifacts | Out-Null
149- if (Test-Path "prepared-artifacts") {
150- Get-ChildItem -Path "prepared-artifacts" | Move-Item -Destination "release-artifacts" -Force
120+ Move-Item $_.FullName -Destination "release-artifacts/" -Force
151121 }
152122
153123 - name : Upload artifacts
@@ -158,7 +128,6 @@ jobs:
158128 release-artifacts/*.exe
159129 release-artifacts/*.dmg
160130 release-artifacts/*.AppImage
161- release-artifacts/*.yml
162131 if-no-files-found : ignore
163132
164133 release :
@@ -180,20 +149,20 @@ jobs:
180149 VERSION=$(node -p "require('./package.json').version")
181150 TAG_NAME="v${VERSION}"
182151 TIMESTAMP=$(date +'%Y%m%d%H%M%S')
183-
152+
184153 git config --global user.name "github-actions[bot]"
185154 git config --global user.email "github-actions[bot]@users.noreply.github.com"
186155 git fetch --tags
187-
156+
188157 # Check if tag already exists, if so append timestamp
189158 if git ls-remote --tags origin "$TAG_NAME" 2>/dev/null | grep -q "refs/tags/$TAG_NAME"; then
190159 echo "Tag $TAG_NAME already exists. Appending timestamp."
191160 TAG_NAME="${TAG_NAME}-${TIMESTAMP}"
192161 fi
193-
162+
194163 echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
195164 echo "Creating tag: $TAG_NAME"
196-
165+
197166 git tag $TAG_NAME
198167 git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git $TAG_NAME
199168
@@ -213,179 +182,44 @@ jobs:
213182 echo "Files in release-artifacts:"
214183 ls -la release-artifacts/ || echo "Directory is empty or doesn't exist"
215184
216- - name : Merge yml files from different architectures
217- run : |
218- cd release-artifacts
219- VERSION=$(node -p "require('../package.json').version")
220- RELEASE_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")
221-
222- # Function to get sha512 from yml file
223- get_sha512() {
224- grep "sha512:" "$1" | head -1 | awk '{print $2}'
225- }
226- get_size() {
227- grep "size:" "$1" | head -1 | awk '{print $2}'
228- }
229-
230- # Merge macOS yml files
231- if [ -f "latest-mac-x64.yml" ] || [ -f "latest-mac-arm64.yml" ]; then
232- echo "Creating latest-mac.yml..."
233- echo "version: ${VERSION}" > latest-mac.yml
234- echo "files:" >> latest-mac.yml
235-
236- if [ -f "latest-mac-x64.yml" ]; then
237- SHA512_X64=$(get_sha512 latest-mac-x64.yml)
238- SIZE_X64=$(get_size latest-mac-x64.yml)
239- echo " - url: StreamGo-${VERSION}.dmg" >> latest-mac.yml
240- echo " sha512: ${SHA512_X64}" >> latest-mac.yml
241- echo " size: ${SIZE_X64}" >> latest-mac.yml
242- fi
243-
244- if [ -f "latest-mac-arm64.yml" ]; then
245- SHA512_ARM64=$(get_sha512 latest-mac-arm64.yml)
246- SIZE_ARM64=$(get_size latest-mac-arm64.yml)
247- echo " - url: StreamGo-${VERSION}-arm64.dmg" >> latest-mac.yml
248- echo " sha512: ${SHA512_ARM64}" >> latest-mac.yml
249- echo " size: ${SIZE_ARM64}" >> latest-mac.yml
250- fi
251-
252- # Set default path (prefer x64)
253- if [ -f "latest-mac-x64.yml" ]; then
254- echo "path: StreamGo-${VERSION}.dmg" >> latest-mac.yml
255- echo "sha512: ${SHA512_X64}" >> latest-mac.yml
256- else
257- echo "path: StreamGo-${VERSION}-arm64.dmg" >> latest-mac.yml
258- echo "sha512: ${SHA512_ARM64}" >> latest-mac.yml
259- fi
260- echo "releaseDate: '${RELEASE_DATE}'" >> latest-mac.yml
261-
262- rm -f latest-mac-x64.yml latest-mac-arm64.yml
263- echo "Created latest-mac.yml:"
264- cat latest-mac.yml
265- fi
266-
267- # Merge Linux yml files
268- if [ -f "latest-linux-x64.yml" ] || [ -f "latest-linux-arm64.yml" ]; then
269- echo "Creating latest-linux.yml..."
270- echo "version: ${VERSION}" > latest-linux.yml
271- echo "files:" >> latest-linux.yml
272-
273- if [ -f "latest-linux-x64.yml" ]; then
274- SHA512_X64=$(get_sha512 latest-linux-x64.yml)
275- SIZE_X64=$(get_size latest-linux-x64.yml)
276- echo " - url: StreamGo-${VERSION}.AppImage" >> latest-linux.yml
277- echo " sha512: ${SHA512_X64}" >> latest-linux.yml
278- echo " size: ${SIZE_X64}" >> latest-linux.yml
279- fi
280-
281- if [ -f "latest-linux-arm64.yml" ]; then
282- SHA512_ARM64=$(get_sha512 latest-linux-arm64.yml)
283- SIZE_ARM64=$(get_size latest-linux-arm64.yml)
284- echo " - url: StreamGo-${VERSION}-arm64.AppImage" >> latest-linux.yml
285- echo " sha512: ${SHA512_ARM64}" >> latest-linux.yml
286- echo " size: ${SIZE_ARM64}" >> latest-linux.yml
287- fi
288-
289- if [ -f "latest-linux-x64.yml" ]; then
290- echo "path: StreamGo-${VERSION}.AppImage" >> latest-linux.yml
291- echo "sha512: ${SHA512_X64}" >> latest-linux.yml
292- else
293- echo "path: StreamGo-${VERSION}-arm64.AppImage" >> latest-linux.yml
294- echo "sha512: ${SHA512_ARM64}" >> latest-linux.yml
295- fi
296- echo "releaseDate: '${RELEASE_DATE}'" >> latest-linux.yml
297-
298- rm -f latest-linux-x64.yml latest-linux-arm64.yml
299- echo "Created latest-linux.yml:"
300- cat latest-linux.yml
301- fi
302-
303- # Windows yml (x64 is primary)
304- if [ -f "latest-x64.yml" ]; then
305- mv latest-x64.yml latest.yml
306- echo "Created latest.yml from x64"
307- elif [ -f "latest-arm64.yml" ]; then
308- mv latest-arm64.yml latest.yml
309- echo "Created latest.yml from arm64"
310- fi
311- rm -f latest-arm64.yml 2>/dev/null || true
312-
313- echo "Final yml files:"
314- ls -la *.yml 2>/dev/null || echo "No yml files found"
315-
316185 - name : Rename artifacts to user-friendly names
317186 run : |
318187 cd release-artifacts
319188 VERSION=$(node -p "require('../package.json').version")
320189
321190 echo "Renaming artifacts to user-friendly names..."
322191
323- # Mac DMG files
192+ # Mac DMG files - use underscores to avoid URL encoding issues
324193 for f in *-arm64.dmg; do
325- [ -f "$f" ] && mv "$f" "StreamGo ${VERSION} ( Mac Apple Silicon) .dmg"
194+ [ -f "$f" ] && mv "$f" "StreamGo- ${VERSION}- Mac- Apple- Silicon.dmg"
326195 done
327196 for f in *.dmg; do
328- [[ -f "$f" && ! "$f" =~ "Apple Silicon" ]] && mv "$f" "StreamGo ${VERSION} ( Mac Intel) .dmg" 2>/dev/null || true
197+ [[ -f "$f" && ! "$f" =~ "Apple- Silicon" ]] && mv "$f" "StreamGo- ${VERSION}- Mac- Intel.dmg" 2>/dev/null || true
329198 done
330199
331200 # Windows EXE files - Setup installer
332201 for f in *Setup*.exe; do
333- [ -f "$f" ] && mv "$f" "StreamGo ${VERSION} ( Windows) .exe"
202+ [ -f "$f" ] && mv "$f" "StreamGo- ${VERSION}- Windows.exe"
334203 done
335204 # Windows portable
336205 for f in *.exe; do
337- [[ -f "$f" && ! "$f" =~ "Windows" ]] && mv "$f" "StreamGo ${VERSION} ( Windows Portable) .exe" 2>/dev/null || true
206+ [[ -f "$f" && ! "$f" =~ "Windows" ]] && mv "$f" "StreamGo- ${VERSION}- Windows- Portable.exe" 2>/dev/null || true
338207 done
339208
340209 # Linux AppImage files
341210 for f in *-arm64.AppImage; do
342- [ -f "$f" ] && mv "$f" "StreamGo ${VERSION} ( Linux ARM) .AppImage"
211+ [ -f "$f" ] && mv "$f" "StreamGo- ${VERSION}- Linux- ARM.AppImage"
343212 done
344213 for f in *.AppImage; do
345- [[ -f "$f" && ! "$f" =~ "ARM" ]] && mv "$f" "StreamGo ${VERSION} ( Linux) .AppImage" 2>/dev/null || true
214+ [[ -f "$f" && ! "$f" =~ "ARM" ]] && mv "$f" "StreamGo- ${VERSION}- Linux.AppImage" 2>/dev/null || true
346215 done
347216
348- # Remove blockmap files (only needed for auto-updates, not manual downloads)
217+ # Remove blockmap files
349218 rm -f *.blockmap
350219
351220 echo "Renamed files:"
352221 ls -la
353222
354- - name : Update yml files with new filenames
355- run : |
356- cd release-artifacts
357- VERSION=$(node -p "require('../package.json').version")
358-
359- # Update latest-mac.yml for macOS auto-updates
360- if [ -f "latest-mac.yml" ]; then
361- echo "Updating latest-mac.yml..."
362- # Update arm64 entries
363- sed -i "s|StreamGo-${VERSION}-arm64.dmg|StreamGo ${VERSION} (Mac Apple Silicon).dmg|g" latest-mac.yml
364- # Update x64 entries
365- sed -i "s|StreamGo-${VERSION}.dmg|StreamGo ${VERSION} (Mac Intel).dmg|g" latest-mac.yml
366- cat latest-mac.yml
367- fi
368-
369- # Update latest.yml for Windows auto-updates
370- if [ -f "latest.yml" ]; then
371- echo "Updating latest.yml..."
372- # Update Setup exe
373- sed -i "s|StreamGo Setup ${VERSION}.exe|StreamGo ${VERSION} (Windows).exe|g" latest.yml
374- # Update portable exe
375- sed -i "s|StreamGo ${VERSION}.exe|StreamGo ${VERSION} (Windows Portable).exe|g" latest.yml
376- cat latest.yml
377- fi
378-
379- # Update latest-linux.yml for Linux auto-updates
380- if [ -f "latest-linux.yml" ]; then
381- echo "Updating latest-linux.yml..."
382- # Update arm64 entries
383- sed -i "s|StreamGo-${VERSION}-arm64.AppImage|StreamGo ${VERSION} (Linux ARM).AppImage|g" latest-linux.yml
384- # Update x64 entries
385- sed -i "s|StreamGo-${VERSION}.AppImage|StreamGo ${VERSION} (Linux).AppImage|g" latest-linux.yml
386- cat latest-linux.yml
387- fi
388-
389223 - name : Generate checksums
390224 run : |
391225 cd release-artifacts
@@ -423,7 +257,6 @@ jobs:
423257 release-artifacts/*.exe
424258 release-artifacts/*.dmg
425259 release-artifacts/*.AppImage
426- release-artifacts/*.yml
427260 release-artifacts/SHA256SUMS.txt
428261 fail_on_unmatched_files : false
429262 env :
0 commit comments