From 9fa67e84f6e7e93c6f5bdaefc2d14534277a5b68 Mon Sep 17 00:00:00 2001 From: Sparsh Date: Tue, 21 Apr 2026 02:09:13 +0530 Subject: [PATCH] ci(desktop): add desktop release workflow and cask stub --- .github/workflows/desktop-release.yml | 82 ++++++++++++++++++++ gitnexus-desktop/Formula/gitnexus-desktop.rb | 13 ++++ 2 files changed, 95 insertions(+) create mode 100644 .github/workflows/desktop-release.yml create mode 100644 gitnexus-desktop/Formula/gitnexus-desktop.rb diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml new file mode 100644 index 000000000..adfd9602b --- /dev/null +++ b/.github/workflows/desktop-release.yml @@ -0,0 +1,82 @@ +name: Desktop Release + +on: + push: + tags: + - 'desktop-v*' + +# Concurrency convention: see CONTRIBUTING.md -> "GitHub Actions -- Concurrency Convention". +# Tag refs are unique per release, so distinct tags run in parallel. Re-pushes of the +# same tag serialize. cancel-in-progress: false -- never cancel a publish mid-flight. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: write + +jobs: + release: + name: Build ${{ matrix.label }} + runs-on: ${{ matrix.os }} + timeout-minutes: 90 + env: + CSC_IDENTITY_AUTO_DISCOVERY: 'false' + GH_TOKEN: ${{ github.token }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + label: Windows NSIS + command: npm run build:win + asset_pattern: gitnexus-desktop/release/*/GitNexus Desktop Setup *.exe + - os: macos-latest + label: macOS DMG + command: npm run build:mac + asset_pattern: gitnexus-desktop/release/*/*.dmg + - os: ubuntu-latest + label: Linux AppImage + command: npm run build:linux + asset_pattern: gitnexus-desktop/release/*/*.AppImage + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version: 20 + cache: npm + cache-dependency-path: gitnexus-desktop/package-lock.json + + - name: Install desktop dependencies + run: npm ci + working-directory: gitnexus-desktop + + - name: Build desktop package + run: ${{ matrix.command }} + working-directory: gitnexus-desktop + + - name: Ensure GitHub Release exists + shell: bash + run: | + if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then + exit 0 + fi + + gh release create "$GITHUB_REF_NAME" \ + --title "GitNexus Desktop $GITHUB_REF_NAME" \ + --notes "" || gh release view "$GITHUB_REF_NAME" >/dev/null + + - name: Upload desktop asset to GitHub Release + shell: bash + run: | + pattern='${{ matrix.asset_pattern }}' + mapfile -t files < <(compgen -G "$pattern") + + if [ "${#files[@]}" -eq 0 ]; then + echo "::error::No files matched pattern: $pattern" + exit 1 + fi + + gh release upload "$GITHUB_REF_NAME" "${files[@]}" --clobber diff --git a/gitnexus-desktop/Formula/gitnexus-desktop.rb b/gitnexus-desktop/Formula/gitnexus-desktop.rb new file mode 100644 index 000000000..efb43151b --- /dev/null +++ b/gitnexus-desktop/Formula/gitnexus-desktop.rb @@ -0,0 +1,13 @@ +# NOTE: sha256 will be updated once the first desktop-v* release is published. +# Submit to homebrew/homebrew-cask after first release tag is cut. +cask "gitnexus-desktop" do + version "0.1.0" + sha256 :no_check + + url "https://github.com/abhigyanpatwari/GitNexus/releases/download/desktop-v#{version}/GitNexus-Desktop-#{version}.dmg" + name "GitNexus Desktop" + desc "Cross-platform desktop app for GitNexus code intelligence" + homepage "https://github.com/abhigyanpatwari/GitNexus" + + app "GitNexus Desktop.app" +end \ No newline at end of file