fix: move wails.json to cmd/desktop/ and fix desktop-dev workflow #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Desktop | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| build-macos: | ||
| name: macOS (universal) | ||
| runs-on: macos-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: web/package-lock.json | ||
| - name: Install Wails CLI | ||
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | ||
| - name: Build frontend | ||
| run: make frontend embed | ||
| - name: Build macOS .app (universal) | ||
| run: wails build -platform darwin/universal -ldflags "-X main.version=${GITHUB_REF_NAME#v}" | ||
| - name: Create archive | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| cd build/bin | ||
| zip -r "../../radar-desktop_${VERSION}_darwin_universal.zip" Radar.app | ||
| cd ../.. | ||
| - name: Generate checksum | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| shasum -a 256 "radar-desktop_${VERSION}_darwin_universal.zip" >> checksums-darwin.txt | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: desktop-macos | ||
| path: | | ||
| radar-desktop_*.zip | ||
| checksums-darwin.txt | ||
| retention-days: 1 | ||
| build-windows: | ||
| name: Windows (amd64) | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: web/package-lock.json | ||
| - name: Install Wails CLI | ||
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | ||
| - name: Build frontend | ||
| run: make frontend embed | ||
| - name: Build Windows exe | ||
| run: wails build -platform windows/amd64 -ldflags "-X main.version=${GITHUB_REF_NAME#v}" | ||
| - name: Create archive | ||
| shell: bash | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| cd build/bin | ||
| 7z a "../../radar-desktop_${VERSION}_windows_amd64.zip" Radar.exe | ||
| cd ../.. | ||
| - name: Generate checksum | ||
| shell: bash | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| sha256sum "radar-desktop_${VERSION}_windows_amd64.zip" >> checksums-windows.txt | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: desktop-windows | ||
| path: | | ||
| radar-desktop_*.zip | ||
| checksums-windows.txt | ||
| retention-days: 1 | ||
| build-linux: | ||
| name: Linux (amd64) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.25' | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: web/package-lock.json | ||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev | ||
| - name: Install Wails CLI | ||
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | ||
| - name: Install nfpm | ||
| run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest | ||
| - name: Build frontend | ||
| run: make frontend embed | ||
| - name: Build Linux binary | ||
| run: wails build -platform linux/amd64 -ldflags "-X main.version=${GITHUB_REF_NAME#v}" | ||
| - name: Create archive | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| cd build/bin | ||
| tar czf "../../radar-desktop_${VERSION}_linux_amd64.tar.gz" radar-desktop | ||
| cd ../.. | ||
| - name: Build .deb and .rpm packages | ||
| run: | | ||
| TAG="${GITHUB_REF_NAME}" | ||
| export VERSION="${TAG#v}" | ||
| nfpm package --config deploy/linux/nfpm.yaml --packager deb --target "radar-desktop_${TAG}_linux_amd64.deb" | ||
| nfpm package --config deploy/linux/nfpm.yaml --packager rpm --target "radar-desktop_${TAG}_linux_amd64.rpm" | ||
| - name: Generate checksums | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| sha256sum "radar-desktop_${VERSION}_linux_amd64.tar.gz" >> checksums-linux.txt | ||
| sha256sum "radar-desktop_${VERSION}_linux_amd64.deb" >> checksums-linux.txt | ||
| sha256sum "radar-desktop_${VERSION}_linux_amd64.rpm" >> checksums-linux.txt | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: desktop-linux | ||
| path: | | ||
| radar-desktop_*.tar.gz | ||
| radar-desktop_*.deb | ||
| radar-desktop_*.rpm | ||
| checksums-linux.txt | ||
| retention-days: 1 | ||
| publish: | ||
| name: Publish Desktop Assets | ||
| runs-on: ubuntu-latest | ||
| needs: [build-macos, build-windows, build-linux] | ||
| steps: | ||
| - name: Download macOS artifact | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: desktop-macos | ||
| path: dist | ||
| - name: Download Windows artifact | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: desktop-windows | ||
| path: dist | ||
| - name: Download Linux artifact | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: desktop-linux | ||
| path: dist | ||
| - name: Merge checksums | ||
| run: | | ||
| cd dist | ||
| cat checksums-darwin.txt checksums-windows.txt checksums-linux.txt > checksums-desktop.txt | ||
| rm -f checksums-darwin.txt checksums-windows.txt checksums-linux.txt | ||
| echo "=== Desktop checksums ===" | ||
| cat checksums-desktop.txt | ||
| - name: Upload to GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| cd dist | ||
| for f in radar-desktop_* checksums-desktop.txt; do | ||
| echo "Uploading $f..." | ||
| gh release upload "${{ github.ref_name }}" "$f" --repo "${{ github.repository }}" --clobber | ||
| done | ||
| - name: Update Homebrew cask | ||
| env: | ||
| HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | ||
| run: | | ||
| VERSION="${GITHUB_REF_NAME}" | ||
| VERSION_NUM="${VERSION#v}" | ||
| SHA256=$(sha256sum "dist/radar-desktop_${VERSION}_darwin_universal.zip" | awk '{print $1}') | ||
| git clone https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/skyhook-io/homebrew-tap.git /tmp/homebrew-tap | ||
| mkdir -p /tmp/homebrew-tap/Casks | ||
| cat > /tmp/homebrew-tap/Casks/radar-desktop.rb << 'CASK' | ||
| cask "radar-desktop" do | ||
| version "VERSION_PLACEHOLDER" | ||
| sha256 "SHA256_PLACEHOLDER" | ||
| url "https://github.com/skyhook-io/radar/releases/download/v#{version}/radar-desktop_v#{version}_darwin_universal.zip" | ||
| name "Radar" | ||
| desc "Kubernetes visibility — topology, traffic, and Helm management" | ||
| homepage "https://github.com/skyhook-io/radar" | ||
| app "Radar.app" | ||
| caveats <<~EOS | ||
| Radar Desktop is not yet code-signed. On first launch: | ||
| Right-click Radar.app → Open → click "Open" | ||
| Or install with: brew install --cask --no-quarantine radar-desktop | ||
| EOS | ||
| end | ||
| CASK | ||
| sed -i "s/VERSION_PLACEHOLDER/${VERSION_NUM}/" /tmp/homebrew-tap/Casks/radar-desktop.rb | ||
| sed -i "s/SHA256_PLACEHOLDER/${SHA256}/" /tmp/homebrew-tap/Casks/radar-desktop.rb | ||
| cd /tmp/homebrew-tap | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add Casks/radar-desktop.rb | ||
| if ! git diff --staged --quiet; then | ||
| git commit -m "Update radar-desktop cask to ${VERSION}" | ||
| git push origin main | ||
| fi | ||