Skip to content

Commit 717552d

Browse files
authored
feat(ci): publish desktop builds to releases (#11) (#12)
### Issue for this PR N/A - release automation follow-up. ### Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? Publishes successful desktop package artifacts from main builds into an auto-managed GitHub Release. Older automatic desktop releases matching `app-v*-main.*` are deleted before creating the new release so release storage stays bounded. ### How did you verify your code works? - Ran `actionlint .github/workflows/desktop-build.yml` - Push hook ran `bun turbo typecheck` successfully: 23/23 tasks ### Screenshots / recordings _If this is a UI change, please include a screenshot or recording._ ### Checklist - [x] I have tested my changes locally - [x] I have not included unrelated changes in this PR ### Issue for this PR Closes # ### Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR. **If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!** ### How did you verify your code works? ### Screenshots / recordings _If this is a UI change, please include a screenshot or recording._ ### Checklist - [ ] I have tested my changes locally - [ ] I have not included unrelated changes in this PR _If you do not follow this template your PR will be automatically rejected._
1 parent b8306a1 commit 717552d

1 file changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/desktop-build.yml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: desktop-build
22

3-
# Internal-beta packaging: builds the desktop app for download as workflow artifacts.
4-
# Does NOT publish, version-bump, or create releases.
3+
# Desktop packaging: builds installable packages and publishes the latest main
4+
# build as an auto-managed GitHub Release.
55
#
66
# macOS signing/notarization is opt-in: if the APPLE_* / CSC_* secrets are present it
77
# signs, otherwise it builds an UNSIGNED package (testers right-click → Open to launch).
@@ -33,7 +33,7 @@ on:
3333
- windows
3434

3535
permissions:
36-
contents: read
36+
contents: write
3737
actions: write
3838

3939
concurrency:
@@ -157,3 +157,46 @@ jobs:
157157
packages/desktop/dist/*.dmg
158158
packages/desktop/dist/*.deb
159159
packages/desktop/dist/*.exe
160+
161+
release:
162+
needs: build
163+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
164+
runs-on: ubuntu-24.04
165+
steps:
166+
- uses: actions/checkout@v4
167+
168+
- uses: actions/download-artifact@v4
169+
with:
170+
pattern: deepagent-code-desktop-*
171+
path: release-assets
172+
merge-multiple: true
173+
174+
- name: Publish latest desktop release
175+
env:
176+
GH_TOKEN: ${{ github.token }}
177+
REPOSITORY: ${{ github.repository }}
178+
run: |
179+
set -euo pipefail
180+
181+
version=$(node -p 'require("./packages/desktop/package.json").version.replace(/-.*/, "")')
182+
tag="app-v${version}-main.${GITHUB_RUN_NUMBER}"
183+
184+
mapfile -t assets < <(find release-assets -type f \( -name '*.dmg' -o -name '*.deb' -o -name '*.exe' \) | sort)
185+
if [ "${#assets[@]}" -eq 0 ]; then
186+
echo "No desktop release assets found"
187+
exit 1
188+
fi
189+
190+
gh release list --repo "$REPOSITORY" --limit 100 --json tagName \
191+
--jq '.[] | select(.tagName | test("^app-v[0-9]+\\.[0-9]+\\.[0-9]+-main\\.")) | .tagName' \
192+
| while read -r old_tag; do
193+
if [ -n "$old_tag" ]; then
194+
gh release delete "$old_tag" --repo "$REPOSITORY" --cleanup-tag -y
195+
fi
196+
done
197+
198+
gh release create "$tag" "${assets[@]}" \
199+
--repo "$REPOSITORY" \
200+
--latest \
201+
--title "DeepAgent Code Desktop ${version} (${GITHUB_SHA::7})" \
202+
--notes "Automated desktop build from main at ${GITHUB_SHA}."

0 commit comments

Comments
 (0)