Skip to content

Commit 4d09268

Browse files
committed
fix: query draft release by list API and fix stat on Windows
1 parent e114b2a commit 4d09268

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/desktop-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,16 @@ jobs:
143143
env:
144144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145145
run: |
146-
# Get release upload URL
146+
# Get release ID (draft releases are not queryable by tag, use list API)
147147
RELEASE_ID=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
148-
"https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}" \
149-
| jq -r '.id')
148+
"https://api.github.com/repos/${{ github.repository }}/releases" \
149+
| jq -r '.[] | select(.tag_name == "${{ github.ref_name }}") | .id' | head -1)
150150
echo "Release ID: $RELEASE_ID"
151151
152152
for file in apps/desktop/release/*.dmg apps/desktop/release/*.zip apps/desktop/release/*.exe; do
153153
[ -f "$file" ] || continue
154154
filename=$(basename "$file")
155-
filesize=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null)
155+
filesize=$(wc -c < "$file" | tr -d ' ')
156156
echo "Uploading $filename ($filesize bytes)..."
157157
158158
# Delete existing asset if any

0 commit comments

Comments
 (0)