Skip to content

Commit 7c87364

Browse files
committed
fix(ci): switch to gh CLI for releases, weekly dev builds
Replace softprops/action-gh-release with direct gh CLI calls in both nightly-dev.yml and release.yml. The action was failing with "Bad request" when uploading large assets (841MB ZIP, 1.1GB DMG) to existing releases after partial runs. Changes: - Use gh release create + gh release delete for clean re-run handling - Write release notes via printf to a temp file (avoids YAML heredoc issues with unindented list/header lines in block scalars) - Add delete-before-create in nightly-dev to ensure clean state - Switch nightly dev builds from daily to weekly (Sundays at 2 AM UTC) The gh CLI is available on the self-hosted runner and handles large file uploads more reliably than the JS action.
1 parent 916fc8c commit 7c87364

File tree

2 files changed

+66
-50
lines changed

2 files changed

+66
-50
lines changed

.github/workflows/nightly-dev.yml

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Nightly Development Release
1+
name: Weekly Development Release
22

3-
# Automated nightly builds for development channel testing
4-
# Runs at 2 AM UTC if there are changes since last development release
3+
# Automated weekly builds for development channel testing
4+
# Runs at 2 AM UTC on Sundays if there are changes since last development release
55
# Keeps last 7 development releases, deletes older ones
66
# Uses self-hosted runner like the release workflow
77

88
on:
99
schedule:
10-
# Run every day at 2 AM UTC if there are changes
11-
- cron: '0 2 * * *'
10+
# Run every Sunday at 2 AM UTC if there are changes
11+
- cron: '0 2 * * 0'
1212
workflow_dispatch:
1313
# Allow manual triggering
1414

@@ -143,30 +143,40 @@ jobs:
143143
fi
144144
145145
- name: Create GitHub pre-release
146-
uses: softprops/action-gh-release@v2
147-
with:
148-
tag_name: ${{ env.DEV_VERSION }}
149-
name: SAM ${{ env.DEV_VERSION }} (Development)
150-
body: |
151-
⚠️ **This is a DEVELOPMENT pre-release build**
152-
153-
Development builds are released automatically and may contain:
154-
- Bugs and instability
155-
- Incomplete features
156-
- Breaking changes
157-
158-
**Do not use development builds for production work.**
159-
160-
Enable development updates in SAM → Preferences → General → "Receive development updates"
161-
162-
### Changes Since Last Development Release
163-
164-
See commit history for details.
165-
draft: false
166-
prerelease: true
167-
files: |
168-
dist/SAM-${{ env.DEV_VERSION }}.zip
169-
dist/SAM-${{ env.DEV_VERSION }}.dmg
146+
env:
147+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148+
run: |
149+
# Delete any existing release/tag for this version (clean slate for re-runs)
150+
gh release delete "${DEV_VERSION}" --yes 2>/dev/null || true
151+
git push origin --delete "${DEV_VERSION}" 2>/dev/null || true
152+
153+
# Write release notes to a temp file
154+
NOTES_FILE=$(mktemp)
155+
printf '%s\n' \
156+
'> **This is a DEVELOPMENT pre-release build**' \
157+
'' \
158+
'Development builds are released automatically and may contain:' \
159+
'- Bugs and instability' \
160+
'- Incomplete features' \
161+
'- Breaking changes' \
162+
'' \
163+
'**Do not use development builds for production work.**' \
164+
'' \
165+
'Enable development updates in SAM -> Preferences -> General -> "Receive development updates"' \
166+
'' \
167+
'### Changes Since Last Development Release' \
168+
'' \
169+
'See commit history for details.' \
170+
> "$NOTES_FILE"
171+
172+
# Create release and upload assets using gh CLI (more reliable for large files)
173+
gh release create "${DEV_VERSION}" \
174+
--title "SAM ${DEV_VERSION} (Development)" \
175+
--notes-file "$NOTES_FILE" \
176+
--prerelease \
177+
"dist/SAM-${DEV_VERSION}.zip" \
178+
"dist/SAM-${DEV_VERSION}.dmg"
179+
rm -f "$NOTES_FILE"
170180
171181
cleanup-old-releases:
172182
name: Cleanup Old Development Releases

.github/workflows/release.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,30 @@ jobs:
132132
fi
133133
134134
- name: Create GitHub Release
135-
uses: softprops/action-gh-release@v2
136-
with:
137-
tag_name: ${{ steps.version.outputs.VERSION }}
138-
name: SAM ${{ steps.version.outputs.VERSION }}
139-
draft: false
140-
prerelease: false
141-
generate_release_notes: true
142-
files: |
143-
dist/SAM-${{ steps.version.outputs.VERSION }}.dmg
144-
dist/SAM-${{ steps.version.outputs.VERSION }}.zip
145-
body: |
146-
## Downloads
147-
148-
- **[SAM-${{ steps.version.outputs.VERSION }}.dmg](https://github.com/SyntheticAutonomicMind/SAM/releases/download/${{ steps.version.outputs.VERSION }}/SAM-${{ steps.version.outputs.VERSION }}.dmg)** - Recommended installer
149-
- **[SAM-${{ steps.version.outputs.VERSION }}.zip](https://github.com/SyntheticAutonomicMind/SAM/releases/download/${{ steps.version.outputs.VERSION }}/SAM-${{ steps.version.outputs.VERSION }}.zip)** - For Sparkle updates
150-
151-
## Installation
152-
153-
1. Download and open the DMG file
154-
2. Drag SAM.app to your Applications folder
155-
3. Launch SAM from Applications
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
VERSION: ${{ steps.version.outputs.VERSION }}
138+
run: |
139+
# Write release notes to a temp file
140+
NOTES_FILE=$(mktemp)
141+
printf '%s\n' \
142+
'## Downloads' \
143+
'' \
144+
"- **[SAM-${VERSION}.dmg](https://github.com/SyntheticAutonomicMind/SAM/releases/download/${VERSION}/SAM-${VERSION}.dmg)** - Recommended installer" \
145+
"- **[SAM-${VERSION}.zip](https://github.com/SyntheticAutonomicMind/SAM/releases/download/${VERSION}/SAM-${VERSION}.zip)** - For Sparkle updates" \
146+
'' \
147+
'## Installation' \
148+
'' \
149+
'1. Download and open the DMG file' \
150+
'2. Drag SAM.app to your Applications folder' \
151+
'3. Launch SAM from Applications' \
152+
> "$NOTES_FILE"
153+
154+
# Create release and upload assets using gh CLI (more reliable for large files)
155+
gh release create "${VERSION}" \
156+
--title "SAM ${VERSION}" \
157+
--notes-file "$NOTES_FILE" \
158+
--generate-notes \
159+
"dist/SAM-${VERSION}.dmg" \
160+
"dist/SAM-${VERSION}.zip"
161+
rm -f "$NOTES_FILE"

0 commit comments

Comments
 (0)