diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index c7fb18d05..d008ad758 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -15,7 +15,7 @@ permissions: contents: write jobs: - build: + build-mac: name: Build - macOS (${{ matrix.arch }}) runs-on: macos-latest @@ -95,10 +95,81 @@ jobs: retention-days: 30 if-no-files-found: error + build-linux: + name: Build - Linux (${{ matrix.arch }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + arch: [x64, arm64] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: '1.3.2' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-bun- + + - name: Install dependencies + run: bun install --frozen + + # Run prebuild and compile steps before electron-builder + - name: Clean dev folder + working-directory: apps/desktop + run: bun run clean:dev + + - name: Compile app with electron-vite + working-directory: apps/desktop + run: bun run compile:app + + # Build the Electron app for Linux + # Uses --publish never to prevent electron-builder from creating its own release + # The release job handles GitHub release creation + - name: Build Electron app + working-directory: apps/desktop + run: bun run package -- --linux --${{ matrix.arch }} --publish never + + # Upload artifacts + - name: Upload AppImage artifact + uses: actions/upload-artifact@v4 + with: + name: desktop-linux-${{ matrix.arch }}-appimage + path: apps/desktop/release/*.AppImage + retention-days: 30 + if-no-files-found: error + + - name: Upload deb artifact + uses: actions/upload-artifact@v4 + with: + name: desktop-linux-${{ matrix.arch }}-deb + path: apps/desktop/release/*.deb + retention-days: 30 + if-no-files-found: error + + - name: Upload auto-update manifest + uses: actions/upload-artifact@v4 + with: + name: desktop-linux-${{ matrix.arch }}-update-manifest + path: apps/desktop/release/latest-linux*.yml + retention-days: 30 + if-no-files-found: warn + # Create GitHub Release after builds complete release: name: Create GitHub Release - needs: build + needs: [build-mac, build-linux] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/desktop-v') @@ -116,6 +187,8 @@ jobs: run: | cd release-artifacts # Create stable-named copies (without version) for /releases/latest/download/ URLs + + # macOS DMG files for file in *.dmg; do if [[ -f "$file" ]]; then # Extract architecture from filename (e.g., Superset-0.0.1-arm64.dmg -> arm64) @@ -124,6 +197,8 @@ jobs: echo "Created stable copy: Superset-${arch}.dmg" fi done + + # macOS ZIP files for file in *-mac.zip; do if [[ -f "$file" ]]; then # Extract architecture from filename (e.g., Superset-0.0.1-arm64-mac.zip -> arm64) @@ -132,6 +207,27 @@ jobs: echo "Created stable copy: Superset-${arch}-mac.zip" fi done + + # Linux AppImage files + for file in *.AppImage; do + if [[ -f "$file" ]]; then + # Extract architecture from filename (e.g., superset-0.0.1-x64.AppImage -> x64) + arch=$(echo "$file" | sed -E 's/.*-([^-]+)\.AppImage$/\1/') + cp "$file" "superset-${arch}.AppImage" + echo "Created stable copy: superset-${arch}.AppImage" + fi + done + + # Linux deb files + for file in *.deb; do + if [[ -f "$file" ]]; then + # Extract architecture from filename (e.g., superset-0.0.1-amd64.deb -> amd64) + arch=$(echo "$file" | sed -E 's/.*-([^-]+)\.deb$/\1/') + cp "$file" "superset-${arch}.deb" + echo "Created stable copy: superset-${arch}.deb" + fi + done + echo "Release artifacts:" ls -la diff --git a/apps/desktop/create-release.sh b/apps/desktop/create-release.sh index a94708366..a35a09c11 100755 --- a/apps/desktop/create-release.sh +++ b/apps/desktop/create-release.sh @@ -319,8 +319,14 @@ else echo -e "${BLUE}Release URL:${NC} ${RELEASE_URL}" echo -e "${BLUE}Latest URL:${NC} ${LATEST_URL}" echo "" - echo -e "${BLUE}Direct download:${NC}" - echo " • ${LATEST_URL}/download/Superset-arm64.dmg" + echo -e "${BLUE}Direct downloads:${NC}" + echo " macOS:" + echo " • ${LATEST_URL}/download/Superset-arm64.dmg" + echo " Linux:" + echo " • ${LATEST_URL}/download/superset-x64.AppImage" + echo " • ${LATEST_URL}/download/superset-arm64.AppImage" + echo " • ${LATEST_URL}/download/superset-amd64.deb" + echo " • ${LATEST_URL}/download/superset-arm64.deb" echo "" else success "Draft release created!" diff --git a/apps/desktop/electron-builder.ts b/apps/desktop/electron-builder.ts index 306249313..ae9898010 100644 --- a/apps/desktop/electron-builder.ts +++ b/apps/desktop/electron-builder.ts @@ -92,7 +92,16 @@ const config: Configuration = { icon: join(pkg.resources, "build/icons"), category: "Utility", synopsis: pkg.description, - target: ["AppImage", "deb"], + target: [ + { + target: "AppImage", + arch: ["x64", "arm64"], + }, + { + target: "deb", + arch: ["x64", "arm64"], + }, + ], artifactName: `superset-\${version}-\${arch}.\${ext}`, },