From 661e47c341da19a5584558b255ddd7e878c2b1eb Mon Sep 17 00:00:00 2001 From: Michael Ludlow Date: Fri, 26 Dec 2025 13:21:32 -0500 Subject: [PATCH] fix(ci): add auto-updater manifest files and version auto-update (#317) Combined PR with: 1. Alex's version auto-update changes from PR #316 2. Auto-updater manifest file generation fix Changes: - Add --publish never to package scripts to generate .yml manifests - Update all build jobs to upload .yml files as artifacts - Update release step to include .yml files in GitHub release - Auto-bump version in package.json files before tagging This enables the in-app auto-updater to work properly by ensuring latest-mac.yml, latest-linux.yml, and latest.yml are published with each release. Co-authored-by: Alex <63423455+AlexMadera@users.noreply.github.com> --- .github/workflows/beta-release.yml | 68 ++++++++++++++++++++++++++++-- apps/frontend/package.json | 8 ++-- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index bf7328c4..2f0648b2 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -33,7 +33,7 @@ jobs: echo "Valid beta version: $VERSION" create-tag: - name: Create beta tag + name: Update version and create beta tag needs: validate-version runs-on: ubuntu-latest permissions: @@ -44,16 +44,72 @@ jobs: - uses: actions/checkout@v4 with: ref: develop + token: ${{ secrets.GITHUB_TOKEN }} - - name: Create and push tag + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '24' + + - name: Update version in all files + run: | + VERSION="${{ github.event.inputs.version }}" + echo "Updating version to $VERSION in all files..." + + # Update apps/frontend/package.json + cd apps/frontend + npm pkg set version="$VERSION" + echo "✅ Updated apps/frontend/package.json to $VERSION" + cd ../.. + + # Update root package.json + npm pkg set version="$VERSION" + echo "✅ Updated root package.json to $VERSION" + + # Update apps/backend/__init__.py + if [ -f "apps/backend/__init__.py" ]; then + sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" apps/backend/__init__.py + echo "✅ Updated apps/backend/__init__.py to $VERSION" + fi + + # Verify the updates + echo "" + echo "Verification:" + echo " Frontend: $(grep '"version"' apps/frontend/package.json | head -1)" + echo " Root: $(grep '"version"' package.json | head -1)" + if [ -f "apps/backend/__init__.py" ]; then + echo " Backend: $(grep '__version__' apps/backend/__init__.py)" + fi + + - name: Commit version update and create tag if: ${{ github.event.inputs.dry_run != 'true' }} run: | VERSION="${{ github.event.inputs.version }}" git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" + + # Commit version changes + git add apps/frontend/package.json package.json + if [ -f "apps/backend/__init__.py" ]; then + git add apps/backend/__init__.py + fi + git commit -m "chore: bump version to $VERSION for beta release" + + # Create annotated tag git tag -a "v$VERSION" -m "Beta release v$VERSION" + + # Push both commit and tag + git push origin develop git push origin "v$VERSION" - echo "Created tag v$VERSION" + echo "✅ Committed version update and created tag v$VERSION" + + - name: Create tag only (dry run) + if: ${{ github.event.inputs.dry_run == 'true' }} + run: | + VERSION="${{ github.event.inputs.version }}" + echo "DRY RUN: Would commit version update and create tag v$VERSION" + echo "Files that would be updated:" + git status --short # Intel build on Intel runner for native compilation build-macos-intel: @@ -132,6 +188,7 @@ jobs: path: | apps/frontend/dist/*.dmg apps/frontend/dist/*.zip + apps/frontend/dist/*.yml # Apple Silicon build on ARM64 runner for native compilation build-macos-arm64: @@ -210,6 +267,7 @@ jobs: path: | apps/frontend/dist/*.dmg apps/frontend/dist/*.zip + apps/frontend/dist/*.yml build-windows: needs: create-tag @@ -266,6 +324,7 @@ jobs: name: windows-builds path: | apps/frontend/dist/*.exe + apps/frontend/dist/*.yml build-linux: needs: create-tag @@ -319,6 +378,7 @@ jobs: path: | apps/frontend/dist/*.AppImage apps/frontend/dist/*.deb + apps/frontend/dist/*.yml create-release: needs: [create-tag, build-macos-intel, build-macos-arm64, build-windows, build-linux] @@ -340,7 +400,7 @@ jobs: - name: Flatten and validate artifacts run: | mkdir -p release-assets - find dist -type f \( -name "*.dmg" -o -name "*.zip" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" \) -exec cp {} release-assets/ \; + find dist -type f \( -name "*.dmg" -o -name "*.zip" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.yml" \) -exec cp {} release-assets/ \; # Validate that at least one artifact was copied artifact_count=$(find release-assets -type f \( -name "*.dmg" -o -name "*.zip" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" \) | wc -l) diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 8f1b6a47..f45d3cd7 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -31,10 +31,10 @@ "python:download": "node scripts/download-python.cjs", "python:download:all": "node scripts/download-python.cjs --all", "python:verify": "node scripts/verify-python-bundling.cjs", - "package": "npm run python:download && electron-vite build && electron-builder", - "package:mac": "npm run python:download && electron-vite build && electron-builder --mac", - "package:win": "npm run python:download && electron-vite build && electron-builder --win", - "package:linux": "npm run python:download && electron-vite build && electron-builder --linux", + "package": "npm run python:download && electron-vite build && electron-builder --publish never", + "package:mac": "npm run python:download && electron-vite build && electron-builder --mac --publish never", + "package:win": "npm run python:download && electron-vite build && electron-builder --win --publish never", + "package:linux": "npm run python:download && electron-vite build && electron-builder --linux --publish never", "start:packaged:mac": "open dist/mac-arm64/Auto-Claude.app || open dist/mac/Auto-Claude.app", "start:packaged:win": "start \"\" \"dist\\win-unpacked\\Auto-Claude.exe\"", "start:packaged:linux": "./dist/linux-unpacked/auto-claude",